bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug ld/22394] hppa-linux-ld fails to emit dynamic relocations on functi


From: cvs-commit at gcc dot gnu.org
Subject: [Bug ld/22394] hppa-linux-ld fails to emit dynamic relocations on function pointer initialization
Date: Sat, 04 Nov 2017 23:08:27 +0000

https://sourceware.org/bugzilla/show_bug.cgi?id=22394

--- Comment #4 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot 
gnu.org> ---
The master branch has been updated by Alan Modra <address@hidden>:

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=127e8e9f62ed0e7145dfa1172c6253275fc150dd

commit 127e8e9f62ed0e7145dfa1172c6253275fc150dd
Author: Alan Modra <address@hidden>
Date:   Tue Oct 31 18:13:03 2017 +1030

    PR22394, hppa-linux-ld fails to emit dynamic relocations

    gcc -mfast-indirect-calls emits a function pointer initialization
    without a P% (plabel) modifier.  ld does not create the necessary
    dynamic relocations for this to work.  It turns out that the problem
    is caused by the non_got_ref symbol flag.  This flag is set for
    non-pic by check_relocs to indicate that the symbol might need copy
    relocations or dynamic relocations.  Later, the backend
    adjust_dynamic_symbol clears the flag to indicate dynamic relocations
    are needed, but leaves it set when copy relocations were created.  The
    inversion in meaning is insane, but it's that way because the backend
    adjust_dynamic_symbol function doesn't get to look at all symbols..
    Anyway, the insanity works for non-function symbols.  However, the
    flag is left set on any function symbol with a dynamic relocation.

    This patch fixes the non_got_ref handling for function symbols, adds
    -z nocopyreloc for hppa-elf, reports where textrel occurs, and expands
    comments.  The check_relocs change just stops creation of dyn_relocs
    we always threw away later.

        PR 22394
        * elf32-hppa.c (elf32_hppa_check_relocs): Don't create dyn_relocs
        for plabels when non-pic.
        (maybe_set_textrel): New function.
        (readonly_dynrelocs): Move and rewrite.
        (elf32_hppa_adjust_dynamic_symbol): Use it.  Don't create copy
        relocs when def_regular or -z nocopyreloc.  Handle non_got_ref
        for functions.  Expand non_got_ref comments.
        (elf32_hppa_size_dynamic_sections): Use maybe_set_textrel.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]