Files
clang-p2996/lld/test/ELF/systemz-got.s
Ulrich Weigand fe3406e349 [lld] Add target support for SystemZ (s390x) (#75643)
This patch adds full support for linking SystemZ (ELF s390x) object
files. Support should be generally complete:
- All relocation types are supported.
- Full shared library support (DYNAMIC, GOT, PLT, ifunc).
- Relaxation of TLS and GOT relocations where appropriate.
- Platform-specific test cases.

In addition to new platform code and the obvious changes, there were a
few additional changes to common code:

- Add three new RelExpr members (R_GOTPLT_OFF, R_GOTPLT_PC, and
R_PLT_GOTREL) needed to support certain s390x relocations. I chose not
to use a platform-specific name since nothing in the definition of these
relocs is actually platform-specific; it is well possible that other
platforms will need the same.

- A couple of tweaks to TLS relocation handling, as the particular
semantics of the s390x versions differ slightly. See comments in the
code.

This was tested by building and testing >1500 Fedora packages, with only
a handful of failures; as these also have issues when building with LLD
on other architectures, they seem unrelated.

Co-authored-by: Tulio Magno Quites Machado Filho <tuliom@redhat.com>
2024-02-13 11:29:21 +01:00

17 lines
620 B
ArmAsm

# REQUIRES: systemz
# RUN: llvm-mc -filetype=obj -triple=s390x-unknown-linux %s -o %t.o
# RUN: llvm-mc -filetype=obj -triple=s390x-unknown-linux %p/Inputs/shared.s -o %t2.o
# RUN: ld.lld -shared %t2.o -soname=%t2.so -o %t2.so
# RUN: ld.lld -dynamic-linker /lib/ld64.so.1 %t.o %t2.so -o %t
# RUN: llvm-readelf -S -r %t | FileCheck %s
# CHECK: .got PROGBITS {{.*}} {{.*}} 000020 00 WA 0 0 8
# CHECK: Relocation section '.rela.dyn' at offset {{.*}} contains 1 entries:
# CHECK: {{.*}} 000000010000000a R_390_GLOB_DAT 0000000000000000 bar + 0
.global _start
_start:
lgrl %r1,bar@GOT