This is the mail archive of the 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: [committed, PATCH] Always create dynsym section with dynamic sections

On 04/22/2016 11:11 AM, H.J. Lu wrote:
> You need to find a different way to track it.

My problem is not with the motivation, but the method. ->dynsymcount is
initialized to 1 to account for the NULL symbol when an elf_link_hash_table
is initialized. So while the table remains non-empty, any renumbering must
still account for the NULL symbol, *irrespective* of whether on not dynamic
sections were created. Either that or you move the initial NULL symbol
counting from link_hash_table_init() to link_create_dynamic_sections().

This change is causing a two-way dependence between creating a 
link_hash_table (an aspect of implementation) and having dynamic sections
in the output (your ABI issue). You want indirectly ensure that the table
is non-empty whenever dynamic sections are created. But do you also need to
ensure that it is empty when dynamic sections are not created?

Just to be clear, we're talking about the elf_link_hash_table
(implementation), not the dynamic symbol table in the output ELF. The two 
may coincide for dynamic ELFs but not necessarily for static ones.

Please consider:

+ if (dynsymcount != 0 || elf_hash_table (info)->dynamic_sections_created)
+     ++dynsymcount;

Faraz Shahbazker

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