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: readonly_dynrelocs


On Sun, Dec 3, 2017 at 4:52 PM, Alan Modra <amodra@gmail.com> wrote:
> On Fri, Dec 01, 2017 at 04:11:39AM -0800, H.J. Lu wrote:
>> x86 has
>>
>>           if ((info->warn_shared_textrel && bfd_link_pic (info))
>>               || info->error_textrel)
>>             /* xgettext:c-format */
>>             info->callbacks->einfo (_("%P: %B: warning: relocation
>> against `%s' in readonly section `%A'\n"),
>>                                     p->sec->owner, h->root.root.string,
>>                                     p->sec);
>>
>> It warns about relocation in read-only section when --warn-shared-textrel
>> is used.  I checked in this patch to fix it on x86.
> [snip]
>
> Can I suggest making the map file dump unconditional?  The following
> does that and tidies some related things.  OK for the x86 parts?
>
> bfd/
>         * elfxx-x86.c (readonly_dynrelocs): New function.
>         (maybe_set_textrel): New function.  Always prints via minfo and
>         correct "readonly" to "read-only" in warning message., replacing..
>         (_bfd_x86_elf_readonly_dynrelocs): ..this.
>         (_bfd_x86_elf_size_dynamic_sections): Correct "readonly" to
>         "read-only" in warning message.  Formatting.
>         (_bfd_x86_elf_adjust_dynamic_symbol): Use readonly_dynrelocs.
>         * linker.c (bfd_link_hash_traverse): Comment typo fix.
> ld/
>         * testsuite/ld-i386/pr17935-1.d: Adjust expected error.
>         * testsuite/ld-i386/pr17935-2.d: Likewise.
>         * testsuite/ld-x86-64/pr17935-1.d: Likewise.
>         * testsuite/ld-x86-64/pr17935-2.d: Likewise.
>

That is fine.

Thanks.


-- 
H.J.


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