This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [committed, PATCH] Always create dynsym section with dynamic sections
- From: Faraz Shahbazker <faraz dot shahbazker at imgtec dot com>
- To: "H.J. Lu" <hjl dot tools at gmail dot com>
- Cc: Binutils <binutils at sourceware dot org>
- Date: Fri, 22 Apr 2016 11:55:58 -0700
- Subject: Re: [committed, PATCH] Always create dynsym section with dynamic sections
- Authentication-results: sourceware.org; auth=none
- References: <20160223003208 dot GA30022 at intel dot com> <571A59A8 dot 4000700 at imgtec dot com> <CAMe9rOqr+E11vmpMV4Fo8Js_nCdsrcKpWKXQCUy+qSjjod=_hg at mail dot gmail dot com>
On 04/22/2016 11:11 AM, H.J. Lu wrote:
> https://groups.google.com/d/msg/generic-abi/P9oE0srJtJI/ilktL8KJEQAJ
>
> 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;
Regards,
Faraz Shahbazker