This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [gold][patch] Small code refactoring


> I was playing with gold and found a bit of code duplication. The
> attached patch removes it. I tested this with "make check" in the gold
> directory. Is there some other test I should do?

In general, it's a good idea to test both 32-bit and 64-bit builds,
but this change is small enough that one "make check" is sufficient.
I've occasionally also found bugs only with -g or only with -O, so I
usually test both of those as well. (I even found one that only showed
up with -O2 or -O3, but I'm not so rigorous as to test different opt
levels separately every time.)

>        * archive.cc (Archive::get_elf_object_for_member): Update for
>        new make_elf_object signature.
>        * object.cc (make_elf_object): Rename to make_elf_object2. Make it
>        static.
>        (make_elf_object): New.
>        * object.h (make_elf_object): Update signature.
>        * readsyms.cc (Read_symbols::do_read_symbols): Update for
>        new make_elf_object signature.
>        * testsuite/binary_unittest.cc (Sized_binary_test): Update for
>        new make_elf_object signature.
>        * testsuite/object_unittest.cc (Sized_object_test): Update for
>        new make_elf_object signature.

This looks reasonable to me, but I'm not a big fan of the name
"make_elf_object2". How about calling the new one something like
"recognize_and_make_elf_object"? Maybe Ian will have a better
suggestion.

-cary


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]