[Darwin, machopic 8/n] Back out part of PR71767 fix.
authorIain Sandoe <iain@sandoe.co.uk>
Sun, 13 Oct 2019 18:58:50 +0000 (18:58 +0000)
committerIain Sandoe <iains@gcc.gnu.org>
Sun, 13 Oct 2019 18:58:50 +0000 (18:58 +0000)
commitf922d945244558904be6868dc036c31fd05750dd
tree7383287eef15a75a68885e7e0ab27a4bc6cbd000
parent67f192f7687d0cce6cf81e188745a48c71b4b019
[Darwin, machopic 8/n] Back out part of PR71767 fix.

We applied a conservative, but fairly large, hammer to fix PR71767.
However, ideally, we want minimise the number of symbols visible to
ld64 and to match the cases emitted by clang (since that's what ld64
is expecting).  Now we've improved the handling of indirections, we
can make the indirection symbols local when they are in the regular
non-lazy symbol pointers section.  We will continue to make any
indirections in the data section visible (since right now we have no
way to track if a given symbol follows a weak global).
This change makes no difference to handling of labels for constants
(to be revised in a future patch).

There's a mechanical change to a number of tests (allowing 'l' or 'L'
as the indirection symbol prefix).

gcc/ChangeLog:

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

* config/darwin.c (machopic_indirection_name): Rework the
function to emit linker-visible symbols only for indirections
in the data section.  Clean up the code and update comments.

gcc/testsuite/ChangeLog:

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

* gcc.target/i386/indirect-thunk-1.c: Allow 'l' or 'L' in
indirection label prefix, for Darwin.
* gcc.target/i386/indirect-thunk-2.c: Likewise.
* gcc.target/i386/indirect-thunk-3.c: Likewise.
* gcc.target/i386/indirect-thunk-4.c: Likewise.
* gcc.target/i386/indirect-thunk-attr-1.c: Likewise.
* gcc.target/i386/indirect-thunk-attr-2.c: Likewise.
* gcc.target/i386/indirect-thunk-attr-3.c: Likewise.
* gcc.target/i386/indirect-thunk-attr-4.c: Likewise.
* gcc.target/i386/indirect-thunk-attr-5.c: Likewise.
* gcc.target/i386/indirect-thunk-attr-6.c: Likewise.
* gcc.target/i386/indirect-thunk-extern-1.c: Likewise.
* gcc.target/i386/indirect-thunk-extern-2.c: Likewise.
* gcc.target/i386/indirect-thunk-extern-3.c: Likewise.
* gcc.target/i386/indirect-thunk-extern-4.c: Likewise.
* gcc.target/i386/indirect-thunk-inline-1.c: Likewise.
* gcc.target/i386/indirect-thunk-inline-2.c: Likewise.
* gcc.target/i386/indirect-thunk-inline-3.c: Likewise.
* gcc.target/i386/indirect-thunk-inline-4.c: Likewise.
* gcc.target/i386/pr32219-2.c: Likewise.
* gcc.target/i386/pr32219-3.c: Likewise.
* gcc.target/i386/pr32219-4.c: Likewise.
* gcc.target/i386/pr32219-7.c: Likewise.
* gcc.target/i386/pr32219-8.c: Likewise.
* gcc.target/i386/ret-thunk-14.c: Likewise.
* gcc.target/i386/ret-thunk-15.c: Likewise.
* gcc.target/i386/ret-thunk-9.c: Likewise.

From-SVN: r276943
29 files changed:
gcc/ChangeLog
gcc/config/darwin.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/i386/indirect-thunk-1.c
gcc/testsuite/gcc.target/i386/indirect-thunk-2.c
gcc/testsuite/gcc.target/i386/indirect-thunk-3.c
gcc/testsuite/gcc.target/i386/indirect-thunk-4.c
gcc/testsuite/gcc.target/i386/indirect-thunk-attr-1.c
gcc/testsuite/gcc.target/i386/indirect-thunk-attr-2.c
gcc/testsuite/gcc.target/i386/indirect-thunk-attr-3.c
gcc/testsuite/gcc.target/i386/indirect-thunk-attr-4.c
gcc/testsuite/gcc.target/i386/indirect-thunk-attr-5.c
gcc/testsuite/gcc.target/i386/indirect-thunk-attr-6.c
gcc/testsuite/gcc.target/i386/indirect-thunk-extern-1.c
gcc/testsuite/gcc.target/i386/indirect-thunk-extern-2.c
gcc/testsuite/gcc.target/i386/indirect-thunk-extern-3.c
gcc/testsuite/gcc.target/i386/indirect-thunk-extern-4.c
gcc/testsuite/gcc.target/i386/indirect-thunk-inline-1.c
gcc/testsuite/gcc.target/i386/indirect-thunk-inline-2.c
gcc/testsuite/gcc.target/i386/indirect-thunk-inline-3.c
gcc/testsuite/gcc.target/i386/indirect-thunk-inline-4.c
gcc/testsuite/gcc.target/i386/pr32219-2.c
gcc/testsuite/gcc.target/i386/pr32219-3.c
gcc/testsuite/gcc.target/i386/pr32219-4.c
gcc/testsuite/gcc.target/i386/pr32219-7.c
gcc/testsuite/gcc.target/i386/pr32219-8.c
gcc/testsuite/gcc.target/i386/ret-thunk-14.c
gcc/testsuite/gcc.target/i386/ret-thunk-15.c
gcc/testsuite/gcc.target/i386/ret-thunk-9.c