]> git.ipfire.org Git - thirdparty/gcc.git/commit
[Darwin] The need for picsym stubs is dependent on linker used, not OS rev.
authoriains <iains@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 16 Jun 2019 16:21:28 +0000 (16:21 +0000)
committeriains <iains@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 16 Jun 2019 16:21:28 +0000 (16:21 +0000)
commitf7a9de44ce1152865c24d533019cf29bdd5533e2
treebd7d33e097373aee442013ac23887e1909209af5
parent7b01a37d47f6689475f49d0801ad2f24cb7c5ecc
[Darwin] The need for picsym stubs is dependent on linker used, not OS rev.

For very old toolchains, the compiler generated pic symbol stubs that
provide the necessary indirections.  We no longer need this (since xcode
3 era) and it's more efficient for the linker to make one stub when it
knows a symbol is needed that for us to emit them speculatively in every
object.

Our current codegen is making the assumption that a specific OS version
uses a specific linker version - and therefore the presence of support
could be based on the target OS rev.  Of course, that's way too simplistic
(most likely bogus for cross-toolchains) and we want to make things explict.

Since we have detection of the linker version, we can use that directly
(A config test for support for stub-less linking might also be feasible
but much more involved).

Finally, should the user wish to generate code that caters for export to
use in an environment with an older toolchain, the generation of stubs
can be forced from the command line.

In addition to the points above, branch islanding and a long branch opt
for PowerPC Darwin has become conflated with the emission of these stubs
(which is confusing, and will be rectified in a following patch).

2019-06-16  Iain Sandoe  <iain@sandoe.co.uk>

* config/darwin.c (machopic_indirect_call_target): Use renamed
darwin_picsymbol_stubs to decide on output.
(darwin_override_options): Handle darwin_picsymbol_stubs.
* config/darwin.h (MIN_LD64_OMIT_STUBS): New.
(LD64_VERSION): Revise default.
* config/darwin.opt: (mpic-symbol-stubs): New option.
(darwin_picsymbol_stubs): New variable.
* config/i386/darwin.h (TARGET_MACHO_BRANCH_ISLANDS):
rename to TARGET_MACHO_PICSYM_STUBS.
* config/i386/i386.c (output_pic_addr_const): Likewise.
* config/i386/i386.h Likewise.
* config/rs6000/darwin.h: Likewise.
* config/rs6000/rs6000.c (rs6000_call_darwin_1): Use renamed
darwin_picsymbol_stubs.

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