Skip to content

Commit 0a44c37

Browse files
uweigandtuliom
authored andcommitted
[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 <[email protected]> (cherry picked from commit fe3406e)
1 parent 34fdf52 commit 0a44c37

36 files changed

+1959
-10
lines changed

lld/ELF/Arch/SystemZ.cpp

Lines changed: 607 additions & 0 deletions
Large diffs are not rendered by default.

lld/ELF/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ add_lld_library(lldELF
3333
Arch/PPC64.cpp
3434
Arch/RISCV.cpp
3535
Arch/SPARCV9.cpp
36+
Arch/SystemZ.cpp
3637
Arch/X86.cpp
3738
Arch/X86_64.cpp
3839
ARMErrataFix.cpp

lld/ELF/Driver.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,7 @@ static std::tuple<ELFKind, uint16_t, uint8_t> parseEmulation(StringRef emul) {
200200
.Case("msp430elf", {ELF32LEKind, EM_MSP430})
201201
.Case("elf64_amdgpu", {ELF64LEKind, EM_AMDGPU})
202202
.Case("elf64loongarch", {ELF64LEKind, EM_LOONGARCH})
203+
.Case("elf64_s390", {ELF64BEKind, EM_S390})
203204
.Default({ELFNoneKind, EM_NONE});
204205

205206
if (ret.first == ELFNoneKind)
@@ -1137,7 +1138,7 @@ static SmallVector<StringRef, 0> getSymbolOrderingFile(MemoryBufferRef mb) {
11371138
static bool getIsRela(opt::InputArgList &args) {
11381139
// The psABI specifies the default relocation entry format.
11391140
bool rela = is_contained({EM_AARCH64, EM_AMDGPU, EM_HEXAGON, EM_LOONGARCH,
1140-
EM_PPC, EM_PPC64, EM_RISCV, EM_X86_64},
1141+
EM_PPC, EM_PPC64, EM_RISCV, EM_S390, EM_X86_64},
11411142
config->emachine);
11421143
// If -z rel or -z rela is specified, use the last option.
11431144
for (auto *arg : args.filtered(OPT_z)) {

lld/ELF/InputFiles.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1614,6 +1614,8 @@ static uint16_t getBitcodeMachineKind(StringRef path, const Triple &t) {
16141614
return EM_RISCV;
16151615
case Triple::sparcv9:
16161616
return EM_SPARCV9;
1617+
case Triple::systemz:
1618+
return EM_S390;
16171619
case Triple::x86:
16181620
return t.isOSIAMCU() ? EM_IAMCU : EM_386;
16191621
case Triple::x86_64:

lld/ELF/InputSection.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -654,6 +654,7 @@ static int64_t getTlsTpOffset(const Symbol &s) {
654654

655655
// Variant 2.
656656
case EM_HEXAGON:
657+
case EM_S390:
657658
case EM_SPARCV9:
658659
case EM_386:
659660
case EM_X86_64:
@@ -716,6 +717,10 @@ uint64_t InputSectionBase::getRelocTargetVA(const InputFile *file, RelType type,
716717
case R_GOT_PC:
717718
case R_RELAX_TLS_GD_TO_IE:
718719
return sym.getGotVA() + a - p;
720+
case R_GOTPLT_GOTREL:
721+
return sym.getGotPltVA() + a - in.got->getVA();
722+
case R_GOTPLT_PC:
723+
return sym.getGotPltVA() + a - p;
719724
case R_LOONGARCH_GOT_PAGE_PC:
720725
if (sym.hasFlag(NEEDS_TLSGD))
721726
return getLoongArchPageDelta(in.got->getGlobalDynAddr(sym) + a, p, type);
@@ -807,6 +812,8 @@ uint64_t InputSectionBase::getRelocTargetVA(const InputFile *file, RelType type,
807812
return getLoongArchPageDelta(sym.getPltVA() + a, p, type);
808813
case R_PLT_GOTPLT:
809814
return sym.getPltVA() + a - in.gotPlt->getVA();
815+
case R_PLT_GOTREL:
816+
return sym.getPltVA() + a - in.got->getVA();
810817
case R_PPC32_PLTREL:
811818
// R_PPC_PLTREL24 uses the addend (usually 0 or 0x8000) to indicate r30
812819
// stores _GLOBAL_OFFSET_TABLE_ or .got2+0x8000. The addend is ignored for

lld/ELF/Relocations.cpp

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -203,8 +203,9 @@ static bool isAbsoluteValue(const Symbol &sym) {
203203

204204
// Returns true if Expr refers a PLT entry.
205205
static bool needsPlt(RelExpr expr) {
206-
return oneof<R_PLT, R_PLT_PC, R_PLT_GOTPLT, R_LOONGARCH_PLT_PAGE_PC,
207-
R_PPC32_PLTREL, R_PPC64_CALL_PLT>(expr);
206+
return oneof<R_PLT, R_PLT_PC, R_PLT_GOTREL, R_PLT_GOTPLT, R_GOTPLT_GOTREL,
207+
R_GOTPLT_PC, R_LOONGARCH_PLT_PAGE_PC, R_PPC32_PLTREL,
208+
R_PPC64_CALL_PLT>(expr);
208209
}
209210

210211
bool lld::elf::needsGot(RelExpr expr) {
@@ -233,6 +234,8 @@ static RelExpr toPlt(RelExpr expr) {
233234
return R_PLT_PC;
234235
case R_ABS:
235236
return R_PLT;
237+
case R_GOTREL:
238+
return R_PLT_GOTREL;
236239
default:
237240
return expr;
238241
}
@@ -253,6 +256,8 @@ static RelExpr fromPlt(RelExpr expr) {
253256
return R_ABS;
254257
case R_PLT_GOTPLT:
255258
return R_GOTPLTREL;
259+
case R_PLT_GOTREL:
260+
return R_GOTREL;
256261
default:
257262
return expr;
258263
}
@@ -979,10 +984,10 @@ bool RelocationScanner::isStaticLinkTimeConstant(RelExpr e, RelType type,
979984
if (oneof<R_GOTPLT, R_GOT_OFF, R_RELAX_HINT, R_MIPS_GOT_LOCAL_PAGE,
980985
R_MIPS_GOTREL, R_MIPS_GOT_OFF, R_MIPS_GOT_OFF32, R_MIPS_GOT_GP_PC,
981986
R_AARCH64_GOT_PAGE_PC, R_GOT_PC, R_GOTONLY_PC, R_GOTPLTONLY_PC,
982-
R_PLT_PC, R_PLT_GOTPLT, R_PPC32_PLTREL, R_PPC64_CALL_PLT,
983-
R_PPC64_RELAX_TOC, R_RISCV_ADD, R_AARCH64_GOT_PAGE,
984-
R_LOONGARCH_PLT_PAGE_PC, R_LOONGARCH_GOT, R_LOONGARCH_GOT_PAGE_PC>(
985-
e))
987+
R_PLT_PC, R_PLT_GOTREL, R_PLT_GOTPLT, R_GOTPLT_GOTREL, R_GOTPLT_PC,
988+
R_PPC32_PLTREL, R_PPC64_CALL_PLT, R_PPC64_RELAX_TOC, R_RISCV_ADD,
989+
R_AARCH64_GOT_PAGE, R_LOONGARCH_PLT_PAGE_PC, R_LOONGARCH_GOT,
990+
R_LOONGARCH_GOT_PAGE_PC>(e))
986991
return true;
987992

988993
// These never do, except if the entire file is position dependent or if
@@ -1374,8 +1379,8 @@ static unsigned handleTlsRelocation(RelType type, Symbol &sym,
13741379
R_LOONGARCH_GOT_PAGE_PC, R_GOT_OFF, R_TLSIE_HINT>(expr)) {
13751380
ctx.hasTlsIe.store(true, std::memory_order_relaxed);
13761381
// Initial-Exec relocs can be optimized to Local-Exec if the symbol is
1377-
// locally defined.
1378-
if (execOptimize && isLocalInExecutable) {
1382+
// locally defined. This is not supported on SystemZ.
1383+
if (execOptimize && isLocalInExecutable && config->emachine != EM_S390) {
13791384
c.addReloc({R_RELAX_TLS_IE_TO_LE, type, offset, addend, &sym});
13801385
} else if (expr != R_TLSIE_HINT) {
13811386
sym.setFlags(NEEDS_TLSIE);
@@ -1534,8 +1539,10 @@ void RelocationScanner::scan(ArrayRef<RelTy> rels) {
15341539
// For EhInputSection, OffsetGetter expects the relocations to be sorted by
15351540
// r_offset. In rare cases (.eh_frame pieces are reordered by a linker
15361541
// script), the relocations may be unordered.
1542+
// On SystemZ, all sections need to be sorted by r_offset, to allow TLS
1543+
// relaxation to be handled correctly - see SystemZ::getTlsGdRelaxSkip.
15371544
SmallVector<RelTy, 0> storage;
1538-
if (isa<EhInputSection>(sec))
1545+
if (isa<EhInputSection>(sec) || config->emachine == EM_S390)
15391546
rels = sortRels(rels, storage);
15401547

15411548
end = static_cast<const void *>(rels.end());

lld/ELF/Relocations.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,14 @@ enum RelExpr {
4040
R_GOTPLT,
4141
R_GOTPLTREL,
4242
R_GOTREL,
43+
R_GOTPLT_GOTREL,
44+
R_GOTPLT_PC,
4345
R_NONE,
4446
R_PC,
4547
R_PLT,
4648
R_PLT_PC,
4749
R_PLT_GOTPLT,
50+
R_PLT_GOTREL,
4851
R_RELAX_HINT,
4952
R_RELAX_GOT_PC,
5053
R_RELAX_GOT_PC_NOPIC,

lld/ELF/ScriptParser.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -445,6 +445,7 @@ static std::pair<ELFKind, uint16_t> parseBfdName(StringRef s) {
445445
.Case("elf32-msp430", {ELF32LEKind, EM_MSP430})
446446
.Case("elf32-loongarch", {ELF32LEKind, EM_LOONGARCH})
447447
.Case("elf64-loongarch", {ELF64LEKind, EM_LOONGARCH})
448+
.Case("elf64-s390", {ELF64BEKind, EM_S390})
448449
.Default({ELFNoneKind, EM_NONE});
449450
}
450451

lld/ELF/SyntheticSections.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1419,6 +1419,9 @@ DynamicSection<ELFT>::computeContents() {
14191419
case EM_MIPS:
14201420
addInSec(DT_MIPS_PLTGOT, *in.gotPlt);
14211421
break;
1422+
case EM_S390:
1423+
addInSec(DT_PLTGOT, *in.got);
1424+
break;
14221425
case EM_SPARCV9:
14231426
addInSec(DT_PLTGOT, *in.plt);
14241427
break;

lld/ELF/Target.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,8 @@ TargetInfo *elf::getTarget() {
8787
return getRISCVTargetInfo();
8888
case EM_SPARCV9:
8989
return getSPARCV9TargetInfo();
90+
case EM_S390:
91+
return getSystemZTargetInfo();
9092
case EM_X86_64:
9193
return getX86_64TargetInfo();
9294
}

lld/ELF/Target.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,7 @@ TargetInfo *getPPC64TargetInfo();
186186
TargetInfo *getPPCTargetInfo();
187187
TargetInfo *getRISCVTargetInfo();
188188
TargetInfo *getSPARCV9TargetInfo();
189+
TargetInfo *getSystemZTargetInfo();
189190
TargetInfo *getX86TargetInfo();
190191
TargetInfo *getX86_64TargetInfo();
191192
template <class ELFT> TargetInfo *getMipsTargetInfo();

lld/test/ELF/Inputs/systemz-init.s

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
// glibc < 2.39 used to align .init and .fini code at a 4-byte boundary.
2+
// This file aims to recreate that behavior.
3+
.section .init,"ax",@progbits
4+
.align 4
5+
lg %r4, 272(%r15)

lld/test/ELF/basic-systemz.s

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
# REQUIRES: systemz
2+
# RUN: llvm-mc -filetype=obj -triple=s390x-unknown-linux %s -o %t.o
3+
# RUN: ld.lld --hash-style=sysv -discard-all -shared %t.o -o %t.so
4+
# RUN: llvm-readelf --file-header --program-headers --section-headers --dynamic-table %t.so | FileCheck %s
5+
6+
# Exits with return code 55 on linux.
7+
.text
8+
lghi 2,55
9+
svc 1
10+
11+
# CHECK: ELF Header:
12+
# CHECK-NEXT: Magic: 7f 45 4c 46 02 02 01 00 00 00 00 00 00 00 00 00
13+
# CHECK-NEXT: Class: ELF64
14+
# CHECK-NEXT: Data: 2's complement, big endian
15+
# CHECK-NEXT: Version: 1 (current)
16+
# CHECK-NEXT: OS/ABI: UNIX - System V
17+
# CHECK-NEXT: ABI Version: 0
18+
# CHECK-NEXT: Type: DYN (Shared object file)
19+
# CHECK-NEXT: Machine: IBM S/390
20+
# CHECK-NEXT: Version: 0x1
21+
# CHECK-NEXT: Entry point address: 0x0
22+
# CHECK-NEXT: Start of program headers: 64 (bytes into file)
23+
# CHECK-NEXT: Start of section headers: 768 (bytes into file)
24+
# CHECK-NEXT: Flags: 0x0
25+
# CHECK-NEXT: Size of this header: 64 (bytes)
26+
# CHECK-NEXT: Size of program headers: 56 (bytes)
27+
# CHECK-NEXT: Number of program headers: 7
28+
# CHECK-NEXT: Size of section headers: 64 (bytes)
29+
# CHECK-NEXT: Number of section headers: 11
30+
# CHECK-NEXT: Section header string table index: 9
31+
32+
# CHECK: Section Headers:
33+
# CHECK-NEXT: [Nr] Name Type Address Off Size ES Flg Lk Inf Al
34+
# CHECK-NEXT: [ 0] NULL 0000000000000000 000000 000000 00 0 0 0
35+
# CHECK-NEXT: [ 1] .dynsym DYNSYM 00000000000001c8 0001c8 000018 18 A 3 1 8
36+
# CHECK-NEXT: [ 2] .hash HASH 00000000000001e0 0001e0 000010 04 A 1 0 4
37+
# CHECK-NEXT: [ 3] .dynstr STRTAB 00000000000001f0 0001f0 000001 00 A 0 0 1
38+
# CHECK-NEXT: [ 4] .text PROGBITS 00000000000011f4 0001f4 000006 00 AX 0 0 4
39+
# CHECK-NEXT: [ 5] .dynamic DYNAMIC 0000000000002200 000200 000060 10 WA 3 0 8
40+
# CHECK-NEXT: [ 6] .relro_padding NOBITS 0000000000002260 000260 000da0 00 WA 0 0 1
41+
# CHECK-NEXT: [ 7] .comment PROGBITS 0000000000000000 000260 000008 01 MS 0 0 1
42+
# CHECK-NEXT: [ 8] .symtab SYMTAB 0000000000000000 000268 000030 18 10 2 8
43+
# CHECK-NEXT: [ 9] .shstrtab STRTAB 0000000000000000 000298 000058 00 0 0 1
44+
# CHECK-NEXT: [10] .strtab STRTAB 0000000000000000 0002f0 00000a 00 0 0 1
45+
46+
# CHECK: Program Headers:
47+
# CHECK-NEXT: Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align
48+
# CHECK-NEXT: PHDR 0x000040 0x0000000000000040 0x0000000000000040 0x000188 0x000188 R 0x8
49+
# CHECK-NEXT: LOAD 0x000000 0x0000000000000000 0x0000000000000000 0x0001f1 0x0001f1 R 0x1000
50+
# CHECK-NEXT: LOAD 0x0001f4 0x00000000000011f4 0x00000000000011f4 0x000006 0x000006 R E 0x1000
51+
# CHECK-NEXT: LOAD 0x000200 0x0000000000002200 0x0000000000002200 0x000060 0x000e00 RW 0x1000
52+
# CHECK-NEXT: DYNAMIC 0x000200 0x0000000000002200 0x0000000000002200 0x000060 0x000060 RW 0x8
53+
# CHECK-NEXT: GNU_RELRO 0x000200 0x0000000000002200 0x0000000000002200 0x000060 0x000e00 R 0x1
54+
# CHECK-NEXT: GNU_STACK 0x000000 0x0000000000000000 0x0000000000000000 0x000000 0x000000 RW 0x0
55+
56+
# CHECK: Dynamic section at offset 0x200 contains 6 entries:
57+
# CHECK-NEXT: Tag Type Name/Value
58+
# CHECK-NEXT: 0x0000000000000006 (SYMTAB) 0x1c8
59+
# CHECK-NEXT: 0x000000000000000b (SYMENT) 24 (bytes)
60+
# CHECK-NEXT: 0x0000000000000005 (STRTAB) 0x1f0
61+
# CHECK-NEXT: 0x000000000000000a (STRSZ) 1 (bytes)
62+
# CHECK-NEXT: 0x0000000000000004 (HASH) 0x1e0
63+
# CHECK-NEXT: 0x0000000000000000 (NULL) 0x0

lld/test/ELF/emulation-systemz.s

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# REQUIRES: systemz
2+
# RUN: llvm-mc -filetype=obj -triple=s390x-unknown-linux %s -o %t.o
3+
# RUN: ld.lld -m elf64_s390 %t.o -o %t1
4+
# RUN: llvm-readelf --file-header %t1 | FileCheck %s
5+
# RUN: ld.lld %t.o -o %t2
6+
# RUN: llvm-readelf --file-header %t2 | FileCheck %s
7+
# RUN: echo 'OUTPUT_FORMAT(elf64-s390)' > %t.script
8+
# RUN: ld.lld %t.script %t.o -o %t3
9+
# RUN: llvm-readelf --file-header %t3 | FileCheck %s
10+
11+
# CHECK: ELF Header:
12+
# CHECK-NEXT: Magic: 7f 45 4c 46 02 02 01 00 00 00 00 00 00 00 00 00
13+
# CHECK-NEXT: Class: ELF64
14+
# CHECK-NEXT: Data: 2's complement, big endian
15+
# CHECK-NEXT: Version: 1 (current)
16+
# CHECK-NEXT: OS/ABI: UNIX - System V
17+
# CHECK-NEXT: ABI Version: 0
18+
# CHECK-NEXT: Type: EXEC (Executable file)
19+
# CHECK-NEXT: Machine: IBM S/390
20+
# CHECK-NEXT: Version: 0x1
21+
# CHECK-NEXT: Entry point address:
22+
# CHECK-NEXT: Start of program headers: 64 (bytes into file)
23+
# CHECK-NEXT: Start of section headers:
24+
# CHECK-NEXT: Flags: 0x0
25+
# CHECK-NEXT: Size of this header: 64 (bytes)
26+
# CHECK-NEXT: Size of program headers: 56 (bytes)
27+
28+
.globl _start
29+
_start:

lld/test/ELF/lto/systemz.ll

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
; REQUIRES: systemz
2+
;; Test we can infer the e_machine value EM_S390 from a bitcode file.
3+
4+
; RUN: llvm-as %s -o %t.o
5+
; RUN: ld.lld %t.o -o %t
6+
; RUN: llvm-readobj -h %t | FileCheck %s
7+
8+
; CHECK: Class: 64-bit
9+
; CHECK: DataEncoding: BigEndian
10+
; CHECK: Machine: EM_S390
11+
12+
target datalayout = "E-m:e-i1:8:16-i8:8:16-i64:64-f128:64-v128:64-a:8:16-n32:64"
13+
target triple = "s390x-unknown-linux-gnu"
14+
15+
define void @_start() {
16+
entry:
17+
ret void
18+
}

lld/test/ELF/systemz-got.s

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# REQUIRES: systemz
2+
# RUN: llvm-mc -filetype=obj -triple=s390x-unknown-linux %s -o %t.o
3+
# RUN: llvm-mc -filetype=obj -triple=s390x-unknown-linux %p/Inputs/shared.s -o %t2.o
4+
# RUN: ld.lld -shared %t2.o -soname=%t2.so -o %t2.so
5+
6+
# RUN: ld.lld -dynamic-linker /lib/ld64.so.1 %t.o %t2.so -o %t
7+
# RUN: llvm-readelf -S -r %t | FileCheck %s
8+
9+
# CHECK: .got PROGBITS {{.*}} {{.*}} 000020 00 WA 0 0 8
10+
11+
# CHECK: Relocation section '.rela.dyn' at offset {{.*}} contains 1 entries:
12+
# CHECK: {{.*}} 000000010000000a R_390_GLOB_DAT 0000000000000000 bar + 0
13+
14+
.global _start
15+
_start:
16+
lgrl %r1,bar@GOT
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# REQUIRES: systemz
2+
## Verify that R_390_GOTENT optimization is not performed on misaligned symbols.
3+
4+
# RUN: llvm-mc -filetype=obj -relax-relocations -triple=s390x-unknown-linux %s -o %t.o
5+
# RUN: ld.lld %t.o -o %t1
6+
# RUN: llvm-readelf -S -r -x .got -x .got.plt %t1 | FileCheck --check-prefixes=CHECK %s
7+
# RUN: llvm-objdump --no-print-imm-hex -d %t1 | FileCheck --check-prefix=DISASM %s
8+
9+
## We retain one .got entry for the unaligned symbol.
10+
# CHECK: Name Type Address Off Size ES Flg Lk Inf Al
11+
# CHECK: .got PROGBITS 00000000010021e0 0001e0 000020 00 WA 0 0 8
12+
# CHECK-NEXT: .relro_padding NOBITS 0000000001002200 000200 000e00 00 WA 0 0 1
13+
# CHECK-NEXT: .data PROGBITS 0000000001003200 000200 000006 00 WA 0 0 2
14+
15+
# CHECK-LABEL: Hex dump of section '.got':
16+
# CHECK-NEXT: 0x010021e0 00000000 00000000 00000000 00000000
17+
# CHECK-NEXT: 0x010021f0 00000000 00000000 00000000 01003205
18+
19+
# DISASM: Disassembly of section .text:
20+
# DISASM: <_start>:
21+
# DISASM-NEXT: larl %r1, 0x1003200
22+
# DISASM-NEXT: larl %r1, 0x1003200
23+
# DISASM-NEXT: lgrl %r1, 0x10021f8
24+
# DISASM-NEXT: lgrl %r1, 0x10021f8
25+
26+
.data
27+
.globl var_align
28+
.hidden var_align
29+
.align 2
30+
var_align:
31+
.long 0
32+
33+
.data
34+
.globl var_unalign
35+
.hidden var_unalign
36+
.align 2
37+
.byte 0
38+
var_unalign:
39+
.byte 0
40+
41+
.text
42+
.globl _start
43+
.type _start, @function
44+
_start:
45+
lgrl %r1, var_align@GOT
46+
lgrl %r1, var_align@GOT
47+
lgrl %r1, var_unalign@GOT
48+
lgrl %r1, var_unalign@GOT

0 commit comments

Comments
 (0)