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: Multiple symbol with same name?


On Fri, Oct 05, 2018 at 01:13:34PM +0530, kamlesh kumar wrote:
> $nm test.o
> 0000000000000000 T main
>                  U print
>                  U xprint
> 
> $objcopy --redefine-sym print=xprint test.o
> $nm test.o
> 0000000000000000 T main
>                  U xprint
>                  U xprint
> 
> As you can see there is  the two symbols with same name "xprint"  and in
> this case the  objcopy should had  merged the xprint in the symbol table
> to one instance (provided both  has same symbol attributes ) .
> 
> Is that bug in the objcopy utility or do we are missing something here ?

objcopy doesn't do the sort of manipulation of object files you think
it should do.  It's not a linker after all.  (And that is a hint as to
how you might be able to merge those two undefined symbols.)

-- 
Alan Modra
Australia Development Lab, IBM


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