]> git.ipfire.org Git - thirdparty/gcc.git/commit
[Darwin, machopic 6/n] Fix for 67183
authoriains <iains@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 12 Oct 2019 19:41:50 +0000 (19:41 +0000)
committeriains <iains@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 12 Oct 2019 19:41:50 +0000 (19:41 +0000)
commit6b3deec0b4618553a92097c268b58bc80375258c
treef7e3a9fbf75e71b2768e3dc87a3e9d3934a3e236
parent17f9eb2168aedafb878f509da1251a4e5fd3b3e6
[Darwin, machopic 6/n] Fix for 67183

When we're using the LLVM-based assembler (the default on modern Darwin)
the ordering of stubs and non-lazy symbol pointers is important.

Interleaving the output (current GCC behaviour) leads to crashes which
prevents us from building code with symbol stubs.

To resolve this, we order the output of stubs and symbol indirections:

 1. Any indirections in the data section
 2. Symbol stubs.
 3. Non-lazy symbol pointers.

At present, we still emit LTO sections after these.

gcc/ChangeLog:

2019-10-12  Iain Sandoe  <iain@sandoe.co.uk>

PR target/67183
* config/darwin.c (machopic_indirection): New field to flag
non-lazy-symbol-pointers in the data section.
(machopic_indirection_name): Compute if an indirection should
appear in the data section.
(machopic_output_data_section_indirection): New callback split
from machopic_output_indirection.
(machopic_output_stub_indirection): Likewise.
(machopic_output_indirection): Retain the code for non-lazy
symbol pointers in their regular section.
(machopic_finish): Use the new callbacks to order the indirection
output.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@276926 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/ChangeLog
gcc/config/darwin.c