https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59888

--- Comment #20 from Iain Sandoe <iains at gcc dot gnu.org> ---
Author: iains
Date: Fri Oct 18 08:42:41 2019
New Revision: 277145

URL: https://gcc.gnu.org/viewcvs?rev=277145&root=gcc&view=rev
Log:
[Darwin] Amend section for constants with relocations.

Darwin's linker doesn't like text section relocations (they require special
enabling).  The Fortran FE, at least, seems to generate cases where the
initialiser for a pointer constant can need a relocation.  We can handle
this by special-casing SECCAT_RODATA when the relocation is present by
placing the constant in the .const_data section.

gcc/

2019-10-18  Iain Sandoe  <i...@sandoe.co.uk>

        Backport from mainline
        2019-10-05  Iain Sandoe  <i...@sandoe.co.uk>

        PR target/59888
        * config/darwin.c (darwin_rodata_section): Add relocation flag,
        choose const_data section for constants with relocations.
        (machopic_select_section): Pass relocation flag to
        darwin_rodata_section ().


Modified:
    branches/gcc-9-branch/gcc/ChangeLog
    branches/gcc-9-branch/gcc/config/darwin.c

Reply via email to