This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [commited,PATCH] Set root.linker_def on _TLS_MODULE_BASE_
- From: "H.J. Lu" <hjl dot tools at gmail dot com>
- To: Binutils <binutils at sourceware dot org>
- Date: Sun, 15 Feb 2015 19:36:42 -0800
- Subject: Re: [commited,PATCH] Set root.linker_def on _TLS_MODULE_BASE_
- Authentication-results: sourceware.org; auth=none
- References: <20150215175733 dot GA22557 at gmail dot com> <20150216011123 dot GC4274 at bubble dot grove dot modra dot org> <CAMe9rOp6f+nTLM7x2jaKBxut7TNXPgw8trYPphto3B1bnk964g at mail dot gmail dot com> <20150216015117 dot GE4274 at bubble dot grove dot modra dot org>
On Sun, Feb 15, 2015 at 5:51 PM, Alan Modra <amodra@gmail.com> wrote:
> On Sun, Feb 15, 2015 at 05:21:33PM -0800, H.J. Lu wrote:
>> On Sun, Feb 15, 2015 at 5:11 PM, Alan Modra <amodra@gmail.com> wrote:
>> > On Sun, Feb 15, 2015 at 09:57:33AM -0800, H.J. Lu wrote:
>> >> I checked in this patch to set root.linker_def on _TLS_MODULE_BASE_
>> >>
>> >> H.J.
>> >> ---
>> >> * elf32-i386.c (elf_i386_always_size_sections): Set root.linker_def
>> >> on _TLS_MODULE_BASE_.
>> >> * elf64-x86-64.c (elf_x86_64_always_size_sections): Likewise.
>> >
>> > Maybe use _bfd_elf_define_linkage_sym instead?
>>
>> Unfortunately, we can't since the logic is a little bit different:
> [snip]
>> Here we check
>>
>> if (tlsbase && tlsbase->type == STT_TLS)
>
> You could call _bfd_elf_define_linkage_sym after this check, I think.
It changes the type field:
bh = &h->root;
if (!_bfd_generic_link_add_one_symbol (info, abfd, name, BSF_GLOBAL,
sec, 0, NULL, FALSE,
get_elf_backend_data (abfd)->collect,
&bh))
return NULL;
h = (struct elf_link_hash_entry *) bh;
h->def_regular = 1;
h->non_elf = 0;
h->root.linker_def = 1;
h->type = STT_OBJECT;
if (ELF_ST_VISIBILITY (h->other) != STV_INTERNAL)
h->other = (h->other & ~ELF_ST_VISIBILITY (-1)) | STV_HIDDEN;
I will eave it alone to avoid any potential problems.
Thanks for your suggestion.
--
H.J.