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: [commited,PATCH] Set root.linker_def on _TLS_MODULE_BASE_


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.


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