8000 [ELF,test] Specify image base to make -Ttext/--section-start tests le… · llvm/llvm-project@07e2300 · GitHub
[go: up one dir, main page]

Skip to content

Commit 07e2300

Browse files
committed
[ELF,test] Specify image base to make -Ttext/--section-start tests less sensitive
Many tests specify -Ttext, -Tdata, or --section-start without SECTIONS commands. When the specified address is lower than the image base, * In the default --ro-segment case, there will be a read-only PT_LOAD segment covering ELF header/program headers, which may cover no section (as many tests omit .rodata). This appears unusual and has non-ascending p_vaddr. * In the --no-rosegment case, an `error: output file too large` occurs. We will add a diagnostic (#140187) and possibly change layout. Add --image-base to make these tests less sensitive.
1 parent 3972215 commit 07e2300

37 files changed

+109
-109
lines changed

lld/test/ELF/aarch64-reloc-implicit-addend.test

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ REQUIRES: aarch64
1717
# RUN: sed "s/\.rela/\.rel/;s/SHT_RELA/SHT_REL/" rela.yaml > rel.yaml
1818
# RUN: yaml2obj rel.yaml -o rel.o
1919
# RUN: llvm-mc -filetype=obj -triple=aarch64 symbols.s -o symbols.o
20-
# RUN: ld.lld rel.o symbols.o -o a.out --section-start=.data=0x100000 --section-start=.text=0x200000
20+
# RUN: ld.lld rel.o symbols.o -o a.out --image-base=0x80000 --section-start=.data=0x100000 --section-start=.text=0x200000
2121
# RUN: llvm-objdump -s a.out | FileCheck %s --check-prefix=DATALE
2222
# RUN: llvm-objdump -d a.out | FileCheck %s --check-prefix=CODE
2323

@@ -26,7 +26,7 @@ REQUIRES: aarch64
2626
# RUN: sed "s/\.rela/\.rel/;s/SHT_RELA/SHT_REL/" rela_be.yaml > rel_be.yaml
2727
# RUN: yaml2obj rel_be.yaml -o rel_be.o
2828
# RUN: llvm-mc -filetype=obj -triple=aarch64_be symbols.s -o symbols_be.o
29-
# RUN: ld.lld -EB rel_be.o symbols_be.o -o be.out --section-start=.data=0x100000 --section-start=.text=0x200000
29+
# RUN: ld.lld -EB rel_be.o symbols_be.o -o be.out --image-base=0x80000 --section-start=.data=0x100000 --section-start=.text=0x200000
3030
# RUN: llvm-objdump -s be.out | FileCheck %s --check-prefix=DATABE
3131
# RUN: llvm-objdump -d be.out | FileCheck %s --check-prefix=CODE
3232

lld/test/ELF/aarch64-thunk-align.s

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// REQUIRES: aarch64
22
// RUN: llvm-mc -filetype=obj -triple=aarch64 %s -o %t
3-
// RUN: ld.lld -Ttext=0x12000 -defsym long=0x10000000 -defsym short=0x8012004 -defsym short2=0x8012008 -defsym short3=0x801200c %t -o %t.exe
3+
// RUN: ld.lld --image-base=0x12000 -Ttext=0x12000 -defsym long=0x10000000 -defsym short=0x8012004 -defsym short2=0x8012008 -defsym short3=0x801200c %t -o %t.exe
44
// RUN: llvm-objdump -d --no-show-raw-insn %t.exe | FileCheck %s
55

66
/// The AArch64AbsLongThunk requires 8-byte alignment just in case unaligned

lld/test/ELF/arm-cmse-diagnostics.s

+18-18
Original file line numberDiff line numberDiff line change
@@ -25,31 +25,31 @@
2525

2626
/// CMSE Only supported by ARMv8-M architecture or later.
2727
// RUN: llvm-mc -arm-add-build-attributes -filetype=obj -triple=thumbv8m.base app -I %S/Inputs -o app1.o
28-
// RUN: ld.lld --cmse-implib -Ttext=0x8000 --section-start .gnu.sgstubs=0x20000 -o app1 app1.o 2>&1 | FileCheck /dev/null --implicit-check-not=error:
28+
// RUN: ld.lld --cmse-implib -pie -Ttext=0x8000 --section-start .gnu.sgstubs=0x20000 -o app1 app1.o 2>&1 | FileCheck /dev/null --implicit-check-not=error:
2929

3030
// RUN: llvm-mc -arm-add-build-attributes -filetype=obj -triple=thumbv8m.main app -I %S/Inputs -o app2.o
31-
// RUN: ld.lld --cmse-implib -Ttext=0x8000 --section-start .gnu.sgstubs=0x20000 -o app2 app2.o 2>&1 | FileCheck /dev/null --implicit-check-not=error:
31+
// RUN: ld.lld --cmse-implib -pie -Ttext=0x8000 --section-start .gnu.sgstubs=0x20000 -o app2 app2.o 2>&1 | FileCheck /dev/null --implicit-check-not=error:
3232

3333
// RUN: llvm-mc -arm-add-build-attributes -filetype=obj -triple=thumbv8.1m.main app -I %S/Inputs -o app3.o
34-
// RUN: ld.lld --cmse-implib -Ttext=0x8000 --section-start .gnu.sgstubs=0x20000 -o app3 app3.o 2>&1 | FileCheck /dev/null --implicit-check-not=error:
34+
// RUN: ld.lld --cmse-implib -pie -Ttext=0x8000 --section-start .gnu.sgstubs=0x20000 -o app3 app3.o 2>&1 | FileCheck /dev/null --implicit-check-not=error:
3535

3636
/// Expect errors for other architectures.
3737
// RUN: llvm-mc -arm-add-build-attributes -filetype=obj -triple=thumbv9a app -I %S/Inputs -o app4.o
38-
// RUN: not ld.lld --cmse-implib -Ttext=0x8000 --section-start .gnu.sgstubs=0x20000 -o app4 app4.o 2>&1 | FileCheck %s --check-prefixes=ERR_ARCH
38+
// RUN: not ld.lld --cmse-implib --image-base=0x8000 -Ttext=0x8000 --section-start .gnu.sgstubs=0x20000 -o app4 app4.o 2>&1 | FileCheck %s --check-prefixes=ERR_ARCH
3939

4040
// RUN: llvm-mc -arm-add-build-attributes -filetype=obj -triple=armv7-m app -I %S/Inputs -o app5.o
41-
// RUN: not ld.lld --cmse-implib -Ttext=0x8000 --section-start .gnu.sgstubs=0x20000 -o app5 app5.o 2>&1 | FileCheck %s --check-prefixes=ERR_ARCH
41+
// RUN: not ld.lld --cmse-implib --image-base=0x8000 -Ttext=0x8000 --section-start .gnu.sgstubs=0x20000 -o app5 app5.o 2>&1 | FileCheck %s --check-prefixes=ERR_ARCH
4242

4343
// RUN: llvm-mc -arm-add-build-attributes -filetype=obj -triple=armv8-m app -I %S/Inputs -o app6.o
44-
// RUN: not ld.lld --cmse-implib -Ttext=0x8000 --section-start .gnu.sgstubs=0x20000 -o app6 app6.o 2>&1 | FileCheck %s --check-prefixes=ERR_ARCH
44+
// RUN: not ld.lld --cmse-implib --image-base=0x8000 -Ttext=0x8000 --section-start .gnu.sgstubs=0x20000 -o app6 app6.o 2>&1 | FileCheck %s --check-prefixes=ERR_ARCH
4545

4646
/// Invalid triple defaults to v4T. Error.
4747
// RUN: llvm-mc -arm-add-build-attributes -filetype=obj -triple=thumb app -I %S/Inputs -o app7.o
48-
// RUN: not ld.lld --cmse-implib -Ttext=0x8000 --section-start .gnu.sgstubs=0x20000 -o app7 app7.o 2>&1 | FileCheck %s --check-prefixes=ERR_ARCH
48+
// RUN: not ld.lld --cmse-implib --image-base=0x8000 -Ttext=0x8000 --section-start .gnu.sgstubs=0x20000 -o app7 app7.o 2>&1 | FileCheck %s --check-prefixes=ERR_ARCH
4949

5050
/// No build attributes. Error.
5151
// RUN: llvm-mc -filetype=obj -triple=thumb app -I %S/Inputs -o app8.o
52-
// RUN: not ld.lld --cmse-implib -Ttext=0x8000 --section-start .gnu.sgstubs=0x20000 -o app8 app8.o 2>&1 | FileCheck %s --check-prefixes=ERR_ARCH
52+
// RUN: not ld.lld --cmse-implib --image-base=0x8000 -Ttext=0x8000 --section-start .gnu.sgstubs=0x20000 -o app8 app8.o 2>&1 | FileCheck %s --check-prefixes=ERR_ARCH
5353

5454
// ERR_ARCH: CMSE is only supported by ARMv8-M architecture or later
5555

@@ -62,20 +62,20 @@
6262
/// Create a new import library with the secure gateway veneer and .gnu.sgstubs specified at the same address
6363
// RUN: ld.lld --cmse-implib --section-start .gnu.sgstubs=0x10000 1.o -o 2 --out-implib=2.lib --in-implib=1.lib 2>&1 | FileCheck /dev/null --implicit-check-not=error:
6464
/// Create a new import library with the secure gateway veneer specified at a same address but .gnu.sgstubs at a higher address.
65-
// RUN: not ld.lld --cmse-implib --section-start .gnu.sgstubs=0x11000 1.o -o 3 --out-implib=3.lib --in-implib=1.lib 2>&1 | FileCheck %s --check-prefixes=ERR_ADDR
65+
// RUN: not ld.lld --cmse-implib -pie --section-start .gnu.sgstubs=0x11000 1.o -o 3 --out-implib=3.lib --in-implib=1.lib 2>&1 | FileCheck %s --check-prefixes=ERR_ADDR
6666
/// Create a new import library with the secure gateway veneer specified at a same address but .gnu.sgstubs at a lower address.
67-
// RUN: not ld.lld --cmse-implib --section-start .gnu.sgstubs=0x9000 1.o -o 4 --out-implib=4.lib --in-implib=1.lib 2>&1 | FileCheck %s --check-prefixes=ERR_ADDR
67+
// RUN: not ld.lld --cmse-implib -pie --section-start .gnu.sgstubs=0x9000 1.o -o 4 --out-implib=4.lib --in-implib=1.lib 2>&1 | FileCheck %s --check-prefixes=ERR_ADDR
6868

6969
// ERR_ADDR: error: start address of '.gnu.sgstubs' is different from previous link
7070

7171
/// Test that the address of .gnu.sgstubs can be specified via command line or linker script.
7272
/// Test that the linker errors when the address of .gnu.sgstubs is not specified using either method.
7373

74-
// RUN: ld.lld --cmse-implib -Ttext=0x8000 --section-start .gnu.sgstubs=0x20000 --script with_sgstubs.script 1.o -o 1 2>&1 | FileCheck /dev/null --implicit-check-not=error:
75-
// RUN: ld.lld --cmse-implib -Ttext=0x8000 --section-start .gnu.sgstubs=0x20000 --script wout_sgstubs.script 1.o -o 2 2>&1 | FileCheck /dev/null --implicit-check-not=error:
76-
// RUN: ld.lld --cmse-implib -Ttext=0x8000 --section-start .gnu.sgstubs=0x20000 1.o -o 3 2>&1 | FileCheck /dev/null --implicit-check-not=error:
77-
// RUN: ld.lld --cmse-implib -Ttext=0x8000 --script with_sgstubs.script 1.o -o 4 2>&1 | FileCheck /dev/null --implicit-check-not=error:
78-
// RUN: not ld.lld --cmse-implib -Ttext=0x8000 --script wout_sgstubs.script 1.o -o 5 2>&1 | FileCheck %s --check-prefixes=ERR_NOADDR
74+
// RUN: ld.lld --cmse-implib --image-base=0x8000 -Ttext=0x8000 --section-start .gnu.sgstubs=0x20000 --script with_sgstubs.script 1.o -o 1 2>&1 | FileCheck /dev/null --implicit-check-not=error:
75+
// RUN: ld.lld --cmse-implib --image-base=0x8000 -Ttext=0x8000 --section-start .gnu.sgstubs=0x20000 --script wout_sgstubs.script 1.o -o 2 2>&1 | FileCheck /dev/null --implicit-check-not=error:
76+
// RUN: ld.lld --cmse-implib --image-base=0x8000 -Ttext=0x8000 --section-start .gnu.sgstubs=0x20000 1.o -o 3 2>&1 | FileCheck /dev/null --implicit-check-not=error:
77+
// RUN: ld.lld --cmse-implib --image-base=0x8000 -Ttext=0x8000 --script with_sgstubs.script 1.o -o 4 2>&1 | FileCheck /dev/null --implicit-check-not=error:
78+
// RUN: not ld.lld --cmse-implib --image-base=0x8000 -Ttext=0x8000 --script wout_sgstubs.script 1.o -o 5 2>&1 | FileCheck %s --check-prefixes=ERR_NOADDR
7979

8080
// RUN: llvm-readelf -S 1 | FileCheck %s --check-prefixes=ADDRCMDLINE
8181
// RUN: llvm-readelf -S 2 | FileCheck %s --check-prefixes=ADDRCMDLINE
@@ -110,9 +110,9 @@
110110
/// Test diagnostics emitted when a symbol is removed from a later version of the import library.
111111
// RUN: llvm-mc -arm-add-build-attributes -filetype=obj -I %S/Inputs --triple=thumbv8m.base libv1 -o libv1.o
112112
// RUN: llvm-mc -arm-add-build-attributes -filetype=obj -I %S/Inputs --triple=thumbv8m.base libv2 -o libv2.o
113-
// RUN: ld.lld -Ttext=0x8000 --section-start .gnu.sgstubs=0x20000 --cmse-implib libv1.o --out-implib=libv1.lib
114-
// RUN: ld.lld -Ttext=0x8000 --section-start .gnu.sgstubs=0x20000 --cmse-implib libv2.o --in-implib=libv1.lib --out-implib=libv2.lib 2>&1 | FileCheck %s --check-prefixes=WARN_MISSING
115-
// RUN: ld.lld -Ttext=0x8000 --section-start .gnu.sgstubs=0x20000 --cmse-implib libv1.o --in-implib=libv2.lib 2>&1 | FileCheck %s --check-prefixes=WARN_NEWENTRY
113+
// RUN: ld.lld --image-base=0x8000 -Ttext=0x8000 --section-start .gnu.sgstubs=0x20000 --cmse-implib libv1.o --out-implib=libv1.lib
114+
// RUN: ld.lld --image-base=0x8000 -Ttext=0x8000 --section-start .gnu.sgstubs=0x20000 --cmse-implib libv2.o --in-implib=libv1.lib --out-implib=libv2.lib 2>&1 | FileCheck %s --check-prefixes=WARN_MISSING
115+
// RUN: ld.lld --image-base=0x8000 -Ttext=0x8000 --section-start .gnu.sgstubs=0x20000 --cmse-implib libv1.o --in-implib=libv2.lib 2>&1 | FileCheck %s --check-prefixes=WARN_NEWENTRY
116116

117117
// WARN_MISSING: warning: entry function 'bar' from CMSE import library is not present in secure application
118118
// WARN_NEWENTRY: warning: new entry function 'bar' introduced but no output import library specified

lld/test/ELF/arm-cmse-implib.s

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@
66
// RUN: llvm-mc -arm-add-build-attributes -filetype=obj --triple=thumbv8m.base implib-v1 -I %S/Inputs -o 1.o
77
// RUN: llvm-mc -arm-add-build-attributes -filetype=obj --triple=thumbv8m.base implib-v2 -I %S/Inputs -o 2.o
88

9-
// RUN: ld.lld -Ttext=0x8000 --section-start .gnu.sgstubs=0x20000 -o 1 app.o --out-implib=1.lib --cmse-implib 1.o
9+
// RUN: ld.lld --image-base=0x8000 -Ttext=0x8000 --section-start .gnu.sgstubs=0x20000 -o 1 app.o --out-implib=1.lib --cmse-implib 1.o
1010
// RUN: llvm-readelf -s 1 1.lib | FileCheck %s --check-prefixes=CHECK1
1111

12-
// RUN: ld.lld -Ttext=0x8000 --section-start .gnu.sgstubs=0x20000 -o 2 app.o --out-implib=2.lib --in-implib=1.lib --cmse-implib 2.o
12+
// RUN: ld.lld --image-base=0x8000 -Ttext=0x8000 --section-start .gnu.sgstubs=0x20000 -o 2 app.o --out-implib=2.lib --in-implib=1.lib --cmse-implib 2.o
1313
// RUN: llvm-readelf -s 2 2.lib | FileCheck %s --check-prefixes=CHECK2
1414

1515
//--- app

lld/test/ELF/arm-cmse-keep-sections.s

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
// RUN: llvm-mc -arm-add-build-attributes -filetype=obj --triple=thumbv8m.main cmse-implib.s -o implib.o -I%S/Inputs/
77
// RUN: llvm-mc -arm-add-build-attributes -filetype=obj --triple=thumbv8m.main cmse-secure-app.s -o secureapp.o
88
/// Create the secure app and import library.
9-
// RUN: ld.lld -e secure_entry --section-start .gnu.sgstubs=0x1000000 --section-start SECURE1=0x10 --section-start SECURE2=0x2000000 --cmse-implib implib.o secureapp.o --out-implib=implib.lib -o secureapp --gc-sections
9+
// RUN: ld.lld -e secure_entry --image-base=0 --section-start .gnu.sgstubs=0x1000000 --section-start SECURE1=0x10 --section-start SECURE2=0x2000000 --cmse-implib implib.o secureapp.o --out-implib=implib.lib -o secureapp --gc-sections
1010
// RUN: llvm-readelf -s implib.lib | FileCheck %s
1111
// RUN: llvm-objdump -d --no-show-raw-insn secureapp | FileCheck %s --check-prefix=DISS
1212

lld/test/ELF/arm-cmse-noveneers.s

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
/// Test that .gnu.sgstubs is size 0 when no linker synthesized secure gateway veneers are created.
44

55
// RUN: llvm-mc -arm-add-build-attributes -filetype=obj --triple=thumbv8m.main %s -I %S/Inputs -o %t.o
6-
// RUN: ld.lld --cmse-implib -Ttext=0x8000 --section-start .gnu.sgstubs=0x20000 %t.o -o %t --out-implib=%t.lib
6+
// RUN: ld.lld --cmse-implib --image-base=0x8000 -Ttext=0x8000 --section-start .gnu.sgstubs=0x20000 %t.o -o %t --out-implib=%t.lib
77
// RUN: llvm-objdump -d --no-show-raw-insn %t | FileCheck %s
88
// RUN: llvm-readelf -S %t | FileCheck %s --check-prefixes=SGSTUBSSIZE
99
// RUN: llvm-readelf -s %t.lib | FileCheck %s --check-prefixes=IMPLIBSYMS

lld/test/ELF/arm-cmse-secure.s

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
/// Create the secure app and import library.
1010
// RUN: ld.lld -e secure_entry --section-start .gnu.sgstubs=0x20000 --cmse-implib implib.o secureapp.o --out-implib=implib.lib -o secureapp
1111
/// Link the non-secure app against the import library.
12-
// RUN: ld.lld -e nonsecure_entry -Ttext=0x8000 implib.lib nonsecureapp.o -o nonsecureapp
12+
// RUN: ld.lld -e nonsecure_entry --image-base=0x8000 -Ttext=0x8000 implib.lib nonsecureapp.o -o nonsecureapp
1313
// RUN: llvm-readelf -s implib.lib | FileCheck %s
1414
// RUN: llvm-objdump -d --no-show-raw-insn secureapp | FileCheck %s --check-prefixes=SECUREDISS
1515
// RUN: llvm-objdump -d --no-show-raw-insn nonsecureapp | FileCheck %s --check-prefixes=NONSECUREDISS

lld/test/ELF/arm-cmse-veneers.s

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
/// are preserved in the executable.
44

55
// RUN: llvm-mc -arm-add-build-attributes -filetype=obj --triple=thumbv8m.main %s -I %S/Inputs -o %t.o
6-
// RUN: ld.lld --cmse-implib -Ttext=0x8000 --section-start .gnu.sgstubs=0x20000 %t.o -o %t
6+
// RUN: ld.lld --cmse-implib --image-base=0x8000 -Ttext=0x8000 --section-start .gnu.sgstubs=0x20000 %t.o -o %t
77
// RUN: llvm-objdump -d --no-show-raw-insn %t | FileCheck %s
88
// RUN: llvm-readelf -s %t | FileCheck %s --check-prefixes=SYM
99

lld/test/ELF/avr-reloc-error.s

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@
33
# RUN: rm -rf %t && split-file %s %t && cd %t
44

55
# RUN: llvm-mc -filetype=obj -triple=avr -mcpu=atmega328 avr-pcrel-7.s -o avr-pcrel-7.o
6-
# RUN: not ld.lld avr-pcrel-7.o -Ttext=0x1000 --defsym=callee0=0x1040 --defsym=callee1=0x1084 --defsym=callee2=0x100f 2>&1 | \
6+
# RUN: not ld.lld avr-pcrel-7.o --image-base=0x1000 -Ttext=0x1000 --defsym=callee0=0x1040 --defsym=callee1=0x1084 --defsym=callee2=0x100f 2>&1 | \
77
# RUN: FileCheck %s --check-prefix=PCREL7
88
# RUN: llvm-mc -filetype=obj -triple=avr -mcpu=atmega328 avr-pcrel-13.s -o avr-pcrel-13.o
9-
# RUN: not ld.lld avr-pcrel-13.o -Ttext=0x1000 --defsym=callee0=0x2000 --defsym=callee1=0x2004 --defsym=callee2=0x100f 2>&1 | \
9+
# RUN: not ld.lld avr-pcrel-13.o --image-base=0x1000 -Ttext=0x1000 --defsym=callee0=0x2000 --defsym=callee1=0x2004 --defsym=callee2=0x100f 2>&1 | \
1010
# RUN: FileCheck %s --check-prefix=PCREL13
1111
# RUN: llvm-mc -filetype=obj -triple=avr -mcpu=atmega328 avr-abs.s -o avr-abs.o
12-
# RUN: not ld.lld avr-abs.o -Ttext=0x1000 --defsym=callee0=0x1009 --defsym=callee1=0x1010 2>&1 | \
12+
# RUN: not ld.lld avr-abs.o --image-base=0x1000 -Ttext=0x1000 --defsym=callee0=0x1009 --defsym=callee1=0x1010 2>&1 | \
1313
# RUN: FileCheck %s --check-prefix=ABS
1414

1515
#--- avr-pcrel-7.s

lld/test/ELF/basic-avr.s

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# REQUIRES: avr
22
# RUN: llvm-mc -filetype=obj -triple=avr-unknown-linux -mcpu=atmega328p %s -o %t.o
3-
# RUN: ld.lld %t.o -o %t.exe -Ttext=0
3+
# RUN: ld.lld %t.o -o %t.exe --image-base=0 -Ttext=0
44
# RUN: llvm-objdump -d %t.exe --mcpu=atmega328 | FileCheck %s --check-prefix=ASM
55
# RUN: llvm-readelf --file-headers --sections -l --symbols %t.exe \
66
# RUN: | FileCheck %s --check-prefix=ELF
@@ -61,8 +61,8 @@ foo:
6161

6262
# ELF: Program Headers:
6363
# ELF-NEXT: Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align
64-
# ELF-NEXT: PHDR 0x000034 0x00010034 0x00010034 0x00080 0x00080 R 0x4
65-
# ELF-NEXT: LOAD 0x000000 0x00010000 0x00010000 0x000b4 0x000b4 R 0x1000
64+
# ELF-NEXT: PHDR 0x000034 0x00000034 0x00000034 0x00080 0x00080 R 0x4
65+
# ELF-NEXT: LOAD 0x000000 0x00000000 0x00000000 0x000b4 0x000b4 R 0x1000
6666
# ELF-NEXT: LOAD 0x001000 0x00000000 0x00000000 0x0000c 0x0000c R E 0x1000
6767
# ELF-NEXT: GNU_STACK 0x000000 0x00000000 0x00000000 0x00000 0x00000 RW 0x0
6868

lld/test/ELF/compress-debug-sections-reloc.s

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t.o
44
# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %S/Inputs/compress-debug.s -o %t2.o
5-
# RUN: ld.lld %t2.o %t.o -o %t1 --compress-debug-sections=zlib -Ttext=0
5+
# RUN: ld.lld %t2.o %t.o -o %t1 --compress-debug-sections=zlib --image-base=0 -Ttext=0
66
# RUN: llvm-dwarfdump %t1 -debug-str | FileCheck %s
77
# These two checks correspond to the patched values of a_sym and a_debug_sym.
88
# D = 0x44 - address of .text input section for this file (the start address of

lld/test/ELF/eh-frame-value-format7.s

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# REQUIRES: x86
22

33
# RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t.o
4-
# RUN: ld.lld --eh-frame-hdr --section-start .text=0x1000 %t.o -o %t
4+
# RUN: ld.lld --eh-frame-hdr --image-base=0 -Ttext=0x1000 %t.o -o %t
55
# RUN: llvm-readobj -S --section-data %t | FileCheck %s
66

77
## Check we are able to handle DW_EH_PE_udata2 encoding.

lld/test/ELF/eh-frame-value-format8.s

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# REQUIRES: x86
22

33
# RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t.o
4-
# RUN: ld.lld --eh-frame-hdr --section-start .text=0x1000 %t.o -o %t
4+
# RUN: ld.lld --eh-frame-hdr --image-base=0 -Ttext=0x1000 %t.o -o %t
55
# RUN: llvm-readobj -S --section-data %t | FileCheck %s
66

77
## Check we are able to handle DW_EH_PE_absptr encoding.

lld/test/ELF/gdb-index-dwarf5-type-unit.s

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@
55
## consider every .debug_info a compile unit).
66

77
# RUN: llvm-mc -filetype=obj -triple=x86_64 %s -o %t.o
8-
# RUN: ld.lld --gdb-index -Ttext=0x1000 %t.o -o %t
8+
# RUN: ld.lld --gdb-index --image-base=0x1000 -Ttext=0x1000 %t.o -o %t
99
# RUN: llvm-dwarfdump --gdb-index %t | FileCheck %s
1010

1111
## Test we don't uncompress a section while another thread is concurrently
1212
## accessing it. This would be detected by tsan as a data race.
1313
# RUN: llvm-objcopy --compress-debug-sections %t.o
14-
# RUN: ld.lld --gdb-index -Ttext=0x1000 %t.o -o %t1
14+
# RUN: ld.lld --gdb-index --image-base=0x1000 -Ttext=0x1000 %t.o -o %t1
1515
# RUN: llvm-dwarfdump --gdb-index %t1 | FileCheck %s
1616

1717
## In this test, there are actually two compile unit .debug_info (very uncommon;

lld/test/ELF/gdb-index-icf.s

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
## range whose low address equals the start address of the output section.
55

66
# RUN: llvm-mc -filetype=obj -triple=x86_64 %s -o %t.o
7-
# RUN: ld.lld --gdb-index --icf=all -Ttext=0x1000 %t.o -o %t
7+
# RUN: ld.lld --gdb-index --icf=all --image-base=0x1000 -Ttext=0x1000 %t.o -o %t
88
# RUN: llvm-dwarfdump --gdb-index %t | FileCheck %s
99

1010
# CHECK: Address area offset = 0x38, has 2 entries:

lld/test/ELF/i386-pc16.test

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# REQUIRES: x86
22

33
# RUN: yaml2obj %s -o %t.o
4-
# RUN: ld.lld -Ttext 0x0 %t.o -o %t.exe
4+
# RUN: ld.lld --image-base=0x0 -Ttext 0x0 %t.o -o %t.exe
55
# RUN: llvm-objdump -s --section=.text %t.exe 2>&1 | FileCheck %s
66

77
# CHECK: Contents of section .text:

lld/test/ELF/i386-pc8.s

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# REQUIRES: x86
22
# RUN: llvm-mc -filetype=obj -triple=i386-pc-linux-gnu %s -o %t1.o
3-
# RUN: ld.lld -Ttext 0x0 %t1.o -o %t.out
3+
# RUN: ld.lld --image-base=0x0 -Ttext 0x0 %t1.o -o %t.out
44
# RUN: llvm-objdump -s --section=.text %t.out | FileCheck %s
55

66
# CHECK: Contents of section .text:

lld/test/ELF/i386-reloc-16-large-addend.s

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# REQUIRES: x86
22
# RUN: llvm-mc -filetype=obj -triple=i386-pc-linux %s -o %t
3-
# RUN: ld.lld -Ttext 0x7c00 %t -o %t2
3+
# RUN: ld.lld --image-base=0x7c00 -Ttext 0x7c00 %t -o %t2
44
# RUN: llvm-objdump -s %t2 | FileCheck %s
55

66
# CHECK: Contents of section .text:

lld/test/ELF/i386-reloc-8-large-addend.s

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# REQUIRES: x86
22
# RUN: llvm-mc -filetype=obj -triple=i386-pc-linux %s -o %t
3-
# RUN: ld.lld -Ttext 0x7c %t -o %t2
3+
# RUN: ld.lld --image-base=0x7c -Ttext 0x7c %t -o %t2
44
# RUN: llvm-objdump -s %t2 | FileCheck %s
55

66
# CHECK: Contents of section .text:

lld/test/ELF/i386-reloc-large-addend.s

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
// RUN: echo ".global foo; foo = 0x1" > %t1.s
55
// RUN: llvm-mc %t1.s -o %t1.o -triple i386-pc-linux -filetype=obj
66

7-
// RUN: ld.lld -Ttext 0x7000 %t.o %t1.o -o %t
7+
// RUN: ld.lld --image-base=0x7000 -Ttext 0x7000 %t.o %t1.o -o %t
88
// RUN: llvm-objdump -d --triple=i386-pc-linux-code16 %t | FileCheck %s
99

1010
// CHECK: Disassembly of section .text:

0 commit comments

Comments
 (0)
0