Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions include/eld/Config/LinkerConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@ class LinkerConfig {
Unset ///< Undetermine code position mode
};

// FIXME: ARM/RISCV/X86 disable ScanRelocations and ApplyRelocations by
// default, likely to avoid non-determinism. With dynsym order now fixed,
// revisit those defaults and whether per phase granularity is still needed.
enum EnableThreadsOpt {
NoThreads = 0,
AssignOutputSections = 0x1,
Expand Down
45 changes: 23 additions & 22 deletions lib/Core/Module.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -378,28 +378,29 @@ bool Module::sortCommonSymbols() {
}

bool Module::sortSymbols() {
std::stable_sort(Symbols.begin(), Symbols.end(),
static_cast<bool (*)(ResolveInfo *, ResolveInfo *)>(
[](ResolveInfo *A, ResolveInfo *B) -> bool {
// Section symbols always appear first.
if (A->type() == ResolveInfo::Section &&
(B->type() != ResolveInfo::Section))
return true;
if (A->type() != ResolveInfo::Section &&
(B->type() == ResolveInfo::Section))
return false;
if (A->isLocal() && !B->isLocal())
return true;
if (!A->isLocal() && B->isLocal())
return false;
// All undefs appear after sections.
if (A->isUndef() && !B->isUndef())
return true;
if (!A->isUndef() && B->isUndef())
return false;
return A->outSymbol()->value() <
B->outSymbol()->value();
}));
auto Cmp = [](ResolveInfo *A, ResolveInfo *B) -> bool {
// Section symbols always appear first.
if (A->type() == ResolveInfo::Section && (B->type() != ResolveInfo::Section))
return true;
if (A->type() != ResolveInfo::Section && (B->type() == ResolveInfo::Section))
return false;
// ELF requires all locals before all globals.
if (A->isLocal() != B->isLocal())
return A->isLocal();
// Deterministic order: by (input ordinal, input .symtab index).
auto OrdA = A->resolvedOrigin()->getInput()->getInputOrdinal();
auto OrdB = B->resolvedOrigin()->getInput()->getInputOrdinal();
if (OrdA != OrdB)
return OrdA < OrdB;
if (A->outSymbol()->getSymbolIndex() != B->outSymbol()->getSymbolIndex())
return A->outSymbol()->getSymbolIndex() < B->outSymbol()->getSymbolIndex();
// Linker-created symbols share an input and carry no input .symtab index;
// break ties by final address then name to keep the order total.
if (A->outSymbol()->value() != B->outSymbol()->value())
return A->outSymbol()->value() < B->outSymbol()->value();
return A->getName() < B->getName();
};
llvm::stable_sort(Symbols, Cmp);
return true;
}

Expand Down
19 changes: 19 additions & 0 deletions lib/Target/GNULDBackend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -819,6 +819,25 @@ void GNULDBackend::sizeDynNamePools() {
// Move all the DynamicSymbols.
// FIXME: Is it really moving?
std::move(PartitionBegin, RVect.end(), std::back_inserter(DynamicSymbols));

// Deterministic .dynsym order: undefined symbols first, then defined;
// within each group by (input ordinal, input .symtab index).
auto Cmp = [](const ResolveInfo *A, const ResolveInfo *B) -> bool {
bool UndA = A->isUndef() || A->isDyn();
bool UndB = B->isUndef() || B->isDyn();
if (UndA != UndB)
return UndA;
auto OrdA = A->resolvedOrigin()->getInput()->getInputOrdinal();
auto OrdB = B->resolvedOrigin()->getInput()->getInputOrdinal();
if (OrdA != OrdB)
return OrdA < OrdB;
return A->outSymbol()->getSymbolIndex() <
B->outSymbol()->getSymbolIndex();
};
// Skip the null symbol at index 0.
llvm::stable_sort(
llvm::make_range(DynamicSymbols.begin() + 1, DynamicSymbols.end()),
Cmp);
}

{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ RUN: %clang %clangopts -fcommon -c %p/Inputs/1.c -o %t1.1.o
RUN: %link %linkopts -o %t1.1.out %t1.1.o --gc-sections -e main -T %p/Inputs/1.script
RUN: %readelf -s %t1.1.out | %filecheck %s
#END_TEST
#CHECK: b_common
#CHECK: a_common
#CHECK: f_common
#CHECK-DAG: b_common
#CHECK-DAG: a_common
#CHECK-DAG: f_common
#CHECK-NOT: c_common
#CHECK-NOT: d_common
#CHECK-NOT: e_common
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ RUN: %clang %clangopts -c %p/Inputs/a.s -fPIC -o %t1.1.o -target aarch64
RUN: %link %linkopts %t1.1.o -shared -o %t1.so -march aarch64
RUN: %objdump -d --dynamic-reloc %t1.so | %filecheck %s

#CHECK-DAG: 00000000000010f0 R_AARCH64_GLOB_DAT first
#CHECK-DAG: 00000000000010f8 R_AARCH64_GLOB_DAT second
#CHECK: 00000000000010f0 R_AARCH64_GLOB_DAT first
#CHECK-NEXT: 00000000000010f8 R_AARCH64_GLOB_DAT second

#CHECK: 1b8: b0000000 adrp x0, 0x1000 <second+0x1000>
#CHECK: 1bc: 9103c000 add x0, x0, #0xf0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ RUN: %readelf -S -s %t.out | %filecheck %s

CHECK: .section1 PROGBITS
CHECK: .others PROGBITS
CHECK: FUNC GLOBAL DEFAULT 1 main_4
CHECK: FUNC GLOBAL DEFAULT 1 main_5
CHECK: OBJECT GLOBAL DEFAULT 1 a5
CHECK: FUNC GLOBAL DEFAULT 2 main_1
CHECK: OBJECT GLOBAL DEFAULT 2 a4
CHECK-DAG: FUNC GLOBAL DEFAULT 1 main_4
CHECK-DAG: FUNC GLOBAL DEFAULT 1 main_5
CHECK-DAG: OBJECT GLOBAL DEFAULT 1 a5
CHECK-DAG: FUNC GLOBAL DEFAULT 2 main_1
CHECK-DAG: OBJECT GLOBAL DEFAULT 2 a4
6 changes: 3 additions & 3 deletions test/ARM/standalone/KeepCommonSymbols/KeepCommonSymbols.test
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ RUN: %clang %clangopts -fcommon -c %p/Inputs/1.c -o %t1.1.o
RUN: %link %linkopts -o %t1.1.out %t1.1.o --gc-sections -e main -T %p/Inputs/1.script
RUN: %readelf -s %t1.1.out | %filecheck %s
#END_TEST
#CHECK: b_common
#CHECK: a_common
#CHECK: f_common
#CHECK-DAG: b_common
#CHECK-DAG: a_common
#CHECK-DAG: f_common
#CHECK-NOT: c_common
#CHECK-NOT: d_common
#CHECK-NOT: e_common
10 changes: 5 additions & 5 deletions test/ARM/standalone/linkerscript/excludeFile/excludeFiles.test
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ RUN: %readelf -S -s %t.out | %filecheck %s

CHECK: .section1 PROGBITS
CHECK: .others PROGBITS
CHECK: FUNC GLOBAL DEFAULT 1 main_4
CHECK: FUNC GLOBAL DEFAULT 1 main_5
CHECK: OBJECT GLOBAL DEFAULT 1 a5
CHECK: FUNC GLOBAL DEFAULT 2 main_1
CHECK: OBJECT GLOBAL DEFAULT 2 a4
CHECK-DAG: FUNC GLOBAL DEFAULT 1 main_4
CHECK-DAG: FUNC GLOBAL DEFAULT 1 main_5
CHECK-DAG: OBJECT GLOBAL DEFAULT 1 a5
CHECK-DAG: FUNC GLOBAL DEFAULT 2 main_1
CHECK-DAG: OBJECT GLOBAL DEFAULT 2 a4

Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
## Repeated links of the same inputs into a shared library must produce
## identical output, even with multithreaded scanning.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Check this on windows too by running the workflow on this PR.


# RUN: rm -rf %t && split-file %s %t
# RUN: %clang %clangopts -c -fPIC -ffunction-sections -fdata-sections %t/a.c -o %t/a.o
# RUN: %clang %clangopts -c -fPIC -ffunction-sections -fdata-sections %t/b.c -o %t/b.o
# RUN: %clang %clangopts -c -fPIC -ffunction-sections -fdata-sections %t/c.c -o %t/c.o

# RUN: %link %linkopts -shared --threads --enable-threads=all %t/a.o %t/b.o %t/c.o -o %t1.so
# RUN: %link %linkopts -shared --threads --enable-threads=all %t/a.o %t/b.o %t/c.o -o %t2.so
# RUN: %link %linkopts -shared --threads --enable-threads=all %t/a.o %t/b.o %t/c.o -o %t3.so
# RUN: %link %linkopts -shared --threads --enable-threads=all %t/a.o %t/b.o %t/c.o -o %t4.so
# RUN: %link %linkopts -shared --threads --enable-threads=all %t/a.o %t/b.o %t/c.o -o %t5.so
# RUN: %link %linkopts -shared --threads --enable-threads=all %t/a.o %t/b.o %t/c.o -o %t6.so
# RUN: %link %linkopts -shared --threads --enable-threads=all %t/a.o %t/b.o %t/c.o -o %t7.so
# RUN: %link %linkopts -shared --threads --enable-threads=all %t/a.o %t/b.o %t/c.o -o %t8.so

# RUN: %readelf -a %t1.so > %t1.dump
# RUN: %readelf -a %t2.so > %t2.dump
# RUN: %readelf -a %t3.so > %t3.dump
# RUN: %readelf -a %t4.so > %t4.dump
# RUN: %readelf -a %t5.so > %t5.dump
# RUN: %readelf -a %t6.so > %t6.dump
# RUN: %readelf -a %t7.so > %t7.dump
# RUN: %readelf -a %t8.so > %t8.dump
# RUN: %diff %t1.dump %t2.dump
# RUN: %diff %t1.dump %t3.dump
# RUN: %diff %t1.dump %t4.dump
# RUN: %diff %t1.dump %t5.dump
# RUN: %diff %t1.dump %t6.dump
# RUN: %diff %t1.dump %t7.dump
# RUN: %diff %t1.dump %t8.dump

#--- a.c
extern int va1, va2, va3, va4, va5, va6, va7, va8;
extern void fa1(void), fa2(void), fa3(void), fa4(void);
int sum_a(void) {
return va1 + va2 + va3 + va4 + va5 + va6 + va7 + va8;
}
void call_a(void) { fa1(); fa2(); fa3(); fa4(); }
int da1 = 1, da2 = 2, da3 = 3, da4 = 4;
const char sa1[] = "a1", sa2[] = "a2";

#--- b.c
extern int vb1, vb2, vb3, vb4, vb5, vb6, vb7, vb8;
extern void fb1(void), fb2(void), fb3(void), fb4(void);
int sum_b(void) {
return vb1 + vb2 + vb3 + vb4 + vb5 + vb6 + vb7 + vb8;
}
void call_b(void) { fb1(); fb2(); fb3(); fb4(); }
int db1 = 1, db2 = 2, db3 = 3, db4 = 4;
const char sb1[] = "b1", sb2[] = "b2";

#--- c.c
extern int vc1, vc2, vc3, vc4, vc5, vc6, vc7, vc8;
extern void fc1(void), fc2(void), fc3(void), fc4(void);
int sum_c(void) {
return vc1 + vc2 + vc3 + vc4 + vc5 + vc6 + vc7 + vc8;
}
void call_c(void) { fc1(); fc2(); fc3(); fc4(); }
int dc1 = 1, dc2 = 2, dc3 = 3, dc4 = 4;
const char sc1[] = "c1", sc2[] = "c2";
34 changes: 34 additions & 0 deletions test/Common/standalone/DynsymSortOrder/DynsymSortOrder.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
## Sort .dynsym: undefined symbols first, then defined symbols, and within
## each group by input ordinal, input .symtab index.

# RUN: rm -rf %t && split-file %s %t
# RUN: %clang %clangopts -c -fPIC %t/a.c -o %t/a.o
# RUN: %clang %clangopts -c -fPIC %t/b.c -o %t/b.o

# RUN: %link %linkopts -shared %t/a.o %t/b.o -o %t.ab.so
# RUN: %readelf --dyn-syms %t.ab.so | %filecheck --check-prefix=AB %s

# AB: OBJECT GLOBAL DEFAULT {{.*}} a_z
# AB-NEXT: OBJECT GLOBAL DEFAULT {{.*}} a_b
# AB-NEXT: OBJECT GLOBAL DEFAULT {{.*}} a_alpha
# AB-NEXT: OBJECT GLOBAL DEFAULT {{.*}} b_m
# AB-NEXT: OBJECT GLOBAL DEFAULT {{.*}} b_n

## Reverse the input order and the dynsym blocks follow.
# RUN: %link %linkopts -shared %t/b.o %t/a.o -o %t.ba.so
# RUN: %readelf --dyn-syms %t.ba.so | %filecheck --check-prefix=BA %s

# BA: OBJECT GLOBAL DEFAULT {{.*}} b_m
# BA-NEXT: OBJECT GLOBAL DEFAULT {{.*}} b_n
# BA-NEXT: OBJECT GLOBAL DEFAULT {{.*}} a_z
# BA-NEXT: OBJECT GLOBAL DEFAULT {{.*}} a_b
# BA-NEXT: OBJECT GLOBAL DEFAULT {{.*}} a_alpha

#--- a.c
int a_z = 1;
int a_b = 2;
int a_alpha = 3;

#--- b.c
int b_m = 4;
int b_n = 5;
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ ELF: [ {{[[:digit:]]+}}] .rela.pgot RELA {{[[:xdigit:]]+}}
ELF: Relocation section '.rela.pgot' at offset 0x{{[[:xdigit:]]+}} contains 1 entries:
ELF: [[#PGOT]] {{[[:xdigit:]]+}} R_RISCV_32 {{0*}}[[#%x,0x2000]] f + 0

ELF: 00001000 {{[[:xdigit:]]+}} NOTYPE GLOBAL DEFAULT {{[[:digit:]]+}} __llvm_patchable_f
ELF: 00002000 {{[[:xdigit:]]+}} FUNC GLOBAL DEFAULT {{[[:digit:]]+}} f
ELF: 00001000 {{[[:xdigit:]]+}} NOTYPE GLOBAL DEFAULT {{[[:digit:]]+}} __llvm_patchable_f

OD: Disassembly of section .plt:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ ELF: [ {{[[:digit:]]+}}] .rela.pgot RELA {{[[:xdigit:]]+}}
ELF: Relocation section '.rela.pgot' at offset 0x{{[[:xdigit:]]+}} contains 1 entries:
ELF: [[#PGOT]] {{[[:xdigit:]]+}} R_RISCV_64 {{0*}}[[#%x,0x2000]] f + 0

ELF: 00001000 {{[[:xdigit:]]+}} NOTYPE GLOBAL DEFAULT {{[[:digit:]]+}} __llvm_patchable_f
ELF: 00002000 {{[[:xdigit:]]+}} FUNC GLOBAL DEFAULT {{[[:digit:]]+}} f
ELF: 00001000 {{[[:xdigit:]]+}} NOTYPE GLOBAL DEFAULT {{[[:digit:]]+}} __llvm_patchable_f

OD: Disassembly of section .plt:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ RUN: %link %linkopts -o %t1.lib1.so %t1.1.o -shared --version-script %p/Inputs/v
RUN: %readelf --dyn-syms --version-info %t1.lib1.so | %filecheck %s
#END_TEST

CHECK-DAG: UND foo{{$}}
CHECK-DAG: {{[0-9]+}} bar@@V1
CHECK: UND foo{{$}}
CHECK-NEXT: {{[0-9]+}} bar@@V1
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ RUN: %clang %clangopts -c -fpic -O2 %p/Inputs/1.c -o %t1.o -ffunction-sections
RUN: %link %linkopts -shared -o %t1.so %t1.o --version-script=%p/Inputs/vs1 --version-script=%p/Inputs/vs2
RUN: %readelf --dyn-syms %t1.so | %filecheck %s

CHECK-DAG: main
CHECK-DAG: bar
CHECK: main
CHECK-NEXT: bar
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ RUN: %ar cr %aropts %tlib24.a %t2.o %t4.o
RUN: %link %linkopts -T %p/Inputs/exclude.t %t1.o --whole-archive %tlib24.a --no-whole-archive %t3.o %t5.o -o %t.out 2>&1
RUN: %readelf -S -s %t.out | %filecheck %s

CHECK: .section1 PROGBITS
CHECK: .others PROGBITS
CHECK: FUNC GLOBAL DEFAULT 1 main_4
CHECK: FUNC GLOBAL DEFAULT 1 main_5
CHECK: OBJECT GLOBAL DEFAULT 1 a5
CHECK: FUNC GLOBAL DEFAULT 2 main_1
CHECK: OBJECT GLOBAL DEFAULT 2 a4
CHECK: .section1 PROGBITS
CHECK: .others PROGBITS
CHECK-DAG: FUNC GLOBAL DEFAULT 1 main_4
CHECK-DAG: FUNC GLOBAL DEFAULT 1 main_5
CHECK-DAG: OBJECT GLOBAL DEFAULT 1 a5
CHECK-DAG: FUNC GLOBAL DEFAULT 2 main_1
CHECK-DAG: OBJECT GLOBAL DEFAULT 2 a4
9 changes: 5 additions & 4 deletions test/Hexagon/Plugin/GetAllSymbols/getallsymbols.test
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,14 @@ LINK-DAG: trampoline_for_far_from_.text.bar_{{[0-9]+}}

# the extra entry is the null symbol
SYMTAB: Symbol table '.symtab' contains 12 entries:
SYMTAB: .text
SYMTAB: .comment
SYMTAB: .hexagon.attributes
SYMTAB: .text
SYMTAB: .text.far
SYMTAB: .text.foo
SYMTAB: trampoline_for_far_from_.text.bar_{{[0-9]+}}
SYMTAB: local
SYMTAB: bar
SYMTAB: far
SYMTAB: ___end
SYMTAB: foo
SYMTAB: __end
SYMTAB: far
SYMTAB: bar
6 changes: 3 additions & 3 deletions test/Hexagon/TLS/TPREL/tprel.test
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ RUN: %readelf -l -S -s -W %t.out | %filecheck %s
#ERR: recompile with -fPIC
# CHECK: .tdata PROGBITS {{[x0-9a-z]+}} {{[x0-9a-z]+}} 000008 00 WAT
# CHECK: .tbss NOBITS {{[x0-9a-z]+}} {{[x0-9a-z]+}} 000004 00 WAT
# CHECK: 00000000 4 TLS GLOBAL DEFAULT {{[0-9]}} src1
# CHECK: 00000004 4 TLS GLOBAL DEFAULT {{[0-9]}} src2
# CHECK: 00000008 4 TLS GLOBAL DEFAULT {{[0-9]}} dst
# CHECK-DAG: 00000000 4 TLS GLOBAL DEFAULT {{[0-9]}} src1
# CHECK-DAG: 00000004 4 TLS GLOBAL DEFAULT {{[0-9]}} src2
# CHECK-DAG: 00000008 4 TLS GLOBAL DEFAULT {{[0-9]}} dst
4 changes: 2 additions & 2 deletions test/Hexagon/TLS/headers/headers.test
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ RUN: %readelf -l -S -s -W %t6.out | %filecheck %s --check-prefix="TBSSDATA"
#ALL: TLS {{[x0-9a-f]+}} {{[x0-9a-f]+}} {{[x0-9a-f]+}} 0x00008 0x00010 R 0x8
#ALL: 01 .tdata .data .bss
#ALL: 02 .tdata .tbss
#ALL: 00000000 8 TLS GLOBAL DEFAULT {{[0-9]}} a
#ALL: 00000008 4 TLS GLOBAL DEFAULT {{[0-9]}} b
#ALL-DAG: 00000000 8 TLS GLOBAL DEFAULT {{[0-9]}} a
#ALL-DAG: 00000008 4 TLS GLOBAL DEFAULT {{[0-9]}} b
#TBSSTDATA: LOAD {{[x0-9a-z]+}} {{[x0-9a-z]+}} {{[x0-9a-z]+}} 0x00004 0x00004 RW 0x1000
#TBSSTDATA: TLS {{[x0-9a-z]+}} {{[x0-9a-z]+}} {{[x0-9a-z]+}} 0x00004 0x00008 R 0x8
#TBSS: TLS {{[x0-9a-z]+}} {{[x0-9a-z]+}} {{[x0-9a-z]+}} 0x00000 0x00008 R 0x8
Expand Down
8 changes: 4 additions & 4 deletions test/Hexagon/linux/ExportFromExe/ExportFromExe.test
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ RUN: %link %linkopts -Bdynamic %t2.o %t.dso.so -o %t.out
RUN: %readelf --dyn-syms %t.out | %filecheck %s

#CHECK-NOT: COM
#CHECK-DAG: common_in_program
#CHECK-DAG: data_in_program
#CHECK-DAG: func_in_program
#CHECK-DAG: variable_in_program
#CHECK: func_in_program
#CHECK-NEXT: variable_in_program
#CHECK-NEXT: data_in_program
#CHECK-NEXT: common_in_program
4 changes: 2 additions & 2 deletions test/Hexagon/linux/MoveCommonsToBSS/movecommon-to-bss.test
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ RUN: %clang %clangg0opts -fcommon -c %p/Inputs/2.c -o %t2.o
RUN: %link %linkg0opts %t1.o %t2.o -o %t.out 2>&1
RUN: %readelf -s %t.out | %filecheck %s

#CHECK: {{[0-9]+}}: {{[x0-9a-z]+}} 4 OBJECT GLOBAL DEFAULT 1 bss
#CHECK: {{[0-9]+}}: {{[x0-9a-z]+}} 4000 OBJECT GLOBAL DEFAULT 1 common1
#CHECK-DAG: {{[0-9]+}}: {{[x0-9a-z]+}} 4 OBJECT GLOBAL DEFAULT 1 bss
#CHECK-DAG: {{[0-9]+}}: {{[x0-9a-z]+}} 4000 OBJECT GLOBAL DEFAULT 1 common1

4 changes: 2 additions & 2 deletions test/Hexagon/linux/TLS/IE/ie.test
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ RUN: %link %linkopts -G0 -dy %t1.o %t2.so -o %t.out
RUN: %readelf -l -r -S -s -W %t.out | %filecheck %s

# CHECK: TLS {{[x0-9a-z]+}} {{[x0-9a-z]+}} {{[x0-9a-z]+}} 0x00004 0x00008 R 0x8
# CHECK-DAG: R_HEX_TPREL_32 00000000 src1 + 0
# CHECK-DAG: R_HEX_TPREL_32 00000000 src2 + 0
# CHECK: R_HEX_TPREL_32 00000000 src1 + 0
# CHECK-NEXT: R_HEX_TPREL_32 00000000 src2 + 0
# CHECK: 00000000 4 TLS GLOBAL DEFAULT {{[0-9]}} dst

6 changes: 3 additions & 3 deletions test/Hexagon/linux/TLS/TPREL/tprel.test
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ RUN: %readelf -l -S -s -W %t.out | %filecheck %s
#ERR: recompile with -fPIC
# CHECK: .tdata PROGBITS {{[x0-9a-z]+}} {{[x0-9a-z]+}} 000008 00 WAT
# CHECK: .tbss NOBITS {{[x0-9a-z]+}} {{[x0-9a-z]+}} 000004 00 WAT
# CHECK: 00000000 4 TLS GLOBAL DEFAULT {{[0-9]}} src1
# CHECK: 00000004 4 TLS GLOBAL DEFAULT {{[0-9]}} src2
# CHECK: 00000008 4 TLS GLOBAL DEFAULT {{[0-9]}} dst
# CHECK-DAG: 00000000 4 TLS GLOBAL DEFAULT {{[0-9]}} src1
# CHECK-DAG: 00000004 4 TLS GLOBAL DEFAULT {{[0-9]}} src2
# CHECK-DAG: 00000008 4 TLS GLOBAL DEFAULT {{[0-9]}} dst
4 changes: 2 additions & 2 deletions test/Hexagon/linux/TLS/headers/headers.test
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ RUN: %readelf -l -S -s -W %t6.out | %filecheck %s --check-prefix="TBSSDATA"
#ALL: TLS {{[x0-9a-f]+}} {{[x0-9a-f]+}} {{[x0-9a-f]+}} 0x00008 0x00010 R 0x8
#ALL: 01 .tdata .data .bss
#ALL: 02 .tdata .tbss
#ALL: 00000000 8 TLS GLOBAL DEFAULT {{[0-9]}} a
#ALL: 00000008 4 TLS GLOBAL DEFAULT {{[0-9]}} b
#ALL-DAG: 00000000 8 TLS GLOBAL DEFAULT {{[0-9]}} a
#ALL-DAG: 00000008 4 TLS GLOBAL DEFAULT {{[0-9]}} b
#TBSSTDATA: LOAD {{[x0-9a-z]+}} {{[x0-9a-z]+}} {{[x0-9a-z]+}} 0x00004 0x00004 RW 0x10000
#TBSSTDATA: TLS {{[x0-9a-z]+}} {{[x0-9a-z]+}} {{[x0-9a-z]+}} 0x00004 0x00008 R 0x8
#TBSS: TLS {{[x0-9a-z]+}} {{[x0-9a-z]+}} {{[x0-9a-z]+}} 0x00000 0x00008 R 0x8
Expand Down
Loading
Loading