Skip to content

Commit ea31070

Browse files
committed
improve test
Created using spr 1.3.5-bogner
1 parent 99fd365 commit ea31070

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

lld/ELF/InputSection.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -665,7 +665,7 @@ static int64_t getTlsTpOffset(const Symbol &s) {
665665
// `tls` may be null, the return value is ignored.
666666
if (s.type != STT_TLS)
667667
return 0;
668-
return s.getVA(0) + (tls ? tls->p_vaddr & (tls->p_align - 1) : 0);
668+
return s.getVA(0) + (tls->p_vaddr & (tls->p_align - 1));
669669

670670
// Variant 2.
671671
case EM_HEXAGON:

lld/test/ELF/riscv-tlsdesc.s

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,9 @@
169169
# IE32-NEXT: lw a0, 0x80(a0)
170170
# IE32-NEXT: add a0, a0, tp
171171

172-
# IE64A-LABEL: 0000000000002340 R_RISCV_TLS_TPREL64 c
172+
# IE64A: OFFSET TYPE VALUE
173+
# IE64A-NEXT: 0000000000002340 R_RISCV_TLS_TPREL64 c
174+
# IE64A-EMPTY:
173175
## &.got[c]-. = 0x2340 - 0x1258 = 0x10e8
174176
# IE64A-LABEL: <.Ltlsdesc_hi2>:
175177
# IE64A-NEXT: addi zero, zero, 0x0

0 commit comments

Comments
 (0)