Disabling the combination of duplicated string table items

pmon mail pmon.mail@gmail.com
Tue Aug 14 15:14:00 GMT 2012


Hi

I have a problem with string table optimization with ld.

I have an object file with two function symbol entries: "foo" and
"myfoo". There are obviously two items in the ".symtab" section for
them and two respective complete null terminated strings in the string
table ".strtab".

I link this object file to shared library with the command:
ld -shared foo.o -o foo.so

When look at the shared library, I see that the ".dynsym" still
contains two items for the two functions, but the ".dynstr" table has
one entry for them "myfoo" and the "foo" symbol uses the index of "f".

This is a neat optimization, but it causes me problems.

Do you have idea how I can disable this merge/combination
optimization? I would like to have two string table items for the two
symbol table items.

I have been told to try "--traditional-format" option with ld, but it
doesn't seem to have any effect on the output.

Thx,
pM0n



More information about the Binutils mailing list