?

Log in

No account? Create an account

moof's prattling

babblebabble


March 4th, 2003

(no subject) @ 04:32 am

Current Mood: accomplished accomplished
Current Music: Low, Half-Light (the crappy non-credits version)

Ha! Take that, GNU Kwalitee Softwearzzzz!

You'd think that after roughly six hours of work, I'd have more to show for it than having changed forty lines of code.

On the other hand, it looks like the ADD meds may be working as advertised.
 
Share  |  |

Comments

 
[User Picture Icon]
From:xeger
Date:March 4th, 2003 09:42 am (UTC)
(Link)
Interestingly enough my immediate reaction was "...are they elegant lines, now?"
[User Picture Icon]
From:moof
Date:March 4th, 2003 11:47 am (UTC)
(Link)
@@ -292,14 +291,16 @@ find_md_root(bfd *abfd, struct symbols s
 
        for (i = 0; i < number_of_symbols; i++) {
                for (s = symbols; s->name != NULL; s++) {
-                       const char *sym = bfd_asymbol_name(symbol_table[i]);
+                       const char *sym = symbol_table[i]->name;
 
                        /*
                         * match symbol prefix '_' or ''.
                         */
                        if (!strcmp(s->name, sym) ||
                            !strcmp(s->name + 1, sym)) {
-                               s->vma = bfd_asymbol_value(symbol_table[i]);
+                               s->offset =
+                                   (size_t)(symbol_table[i]->section->filepos
+                                   + symbol_table[i]->value);
                        }
                }
        }
@@ -307,19 +308,34 @@ find_md_root(bfd *abfd, struct symbols s
        free(symbol_table);
 
        for (s = symbols; s->name != NULL; s++) {
-               if (s->vma == 0)
-                       return (1);
-
-               for (p = abfd->sections; p != NULL; p = p->next) {
-                       if (p->vma > s->vma || p->vma + p->_raw_size < s->vma)
-                               continue;
-
-                       s->offset = (size_t)(p->filepos + (s->vma - p->vma));
-               }
-
                if (s->offset == 0)
                        return (1);
        }
 
        return (0);
 }


the rest of the patch is adding a small support function, changing a few other lines, and in general using the (amazingly enough, clearer) documented interface instead of obscure magic crap. I figure it is.

moof's prattling

babblebabble