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: [PATCH] PR binutils/16317: Set SHF_INFO_LINK bit for SHT_REL/SHT_RELA sections sections


On Wed, Dec 11, 2013 at 4:34 PM, H.J. Lu <hongjiu.lu@intel.com> wrote:
> On Wed, Dec 11, 2013 at 10:18:42AM -0800, H.J. Lu wrote:
>> Hi,
>>
>> This patch adds SHF_INFO_LINK to SHT_RELA/SHT_REL sections generated
>> by ld.  It makes ld behaves the same as gold.  OK to install?
>>
>
> Turns out we should set the HF_INFO_LINK bit for SHT_RELA/SHT_REL
> sections only when setting the sh_info field.  Here is the new
> patch.  Tested on Linux/x86 and Linux/x86-64. OK for trunk?
>
> Thanks.
>
>
> H.J.
> ---
> bfd/
>
> 2013-12-11  H.J. Lu  <hongjiu.lu@intel.com>
>
>         PR binutils/16317
>         * elf.c (assign_section_numbers): Set the SHF_INFO_LINK bit for
>         SHT_REL/SHT_RELA sections when setting the sh_info field.
>
> ld/testsuite/
>
> 2013-12-11  H.J. Lu  <hongjiu.lu@intel.com>
>
>         PR binutils/16317
>         * ld-elf/linkinfo.s: New file.
>         * ld-elf/linkinfo1.d: Likewise.
>         * ld-elf/linkinfo2.d: Likewise.
> index 8df38ee..82c5e78 100644
> --- a/bfd/elf.c
> +++ b/bfd/elf.c
> @@ -3162,7 +3162,10 @@ assign_section_numbers (bfd *abfd, struct bfd_link_info *link_info)
>             name += 5;
>           s = bfd_get_section_by_name (abfd, name);
>           if (s != NULL)
> -           d->this_hdr.sh_info = elf_section_data (s)->this_idx;
> +           {
> +             d->this_hdr.sh_info = elf_section_data (s)->this_idx;
> +             d->this_hdr.sh_flags |= SHF_INFO_LINK;
> +           }
>           break;

Any objections to set SHF_INFO_LINK for SHT_REL/SHT_RELA
sections when setting the sh_info field?

Thanks.

H.J.


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