Skip to content

Fix ARM relocations

Moritz Angermann requested to merge wip/angerman/fix-arm-relocs into master

When producing PIC code some tool-chains prefer to refer to a GLOBAL_OFFSET_TABLE symbol to get a handle on the GOT. So far the linker has simply ignored this case and taken the happy path that LLVM produced.

This adds lookup logic for GLOBAL_OFFSET_TABLE as well as relocation logic for R_ARM_BASE_PREL and R_ARM_GOT_BREL which the gnu toolchain (gas, gcc, ...) prefers to produce. Apparently recent llvm toolchains will produce those as well.

We also disable the atomics logic, as that will only produce stubs on arm32 when there are no atomic operations.

Edited by Ben Gamari

Merge request reports