[Darwin] Amend section for constants with reloactions.
authorIain Sandoe <iain@sandoe.co.uk>
Sat, 5 Oct 2019 08:05:44 +0000 (08:05 +0000)
committerIain Sandoe <iains@gcc.gnu.org>
Sat, 5 Oct 2019 08:05:44 +0000 (08:05 +0000)
commitd56cbcc0a2ae508afbbc1c3d6a6b925971ff2d6e
tree37da718774aa725e2cdedda9923bcf2d3820e4e9
parent8e007055dd1374ca4c44406a4ead172be0dfa3a8
[Darwin] Amend section for constants with reloactions.

Darwin's linker doesn't like text section relocations (they require special
enabling).  At least, the Fortran FE 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/ChangeLog:

2019-10-05  Iain Sandoe  <iain@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 ().

From-SVN: r276623
gcc/ChangeLog
gcc/config/darwin.c