From 5aa29afd916771ec34de469a4112fbadee5444fd Mon Sep 17 00:00:00 2001 From: Feng Zou Date: Wed, 27 Nov 2024 11:13:51 +0800 Subject: [PATCH] [MC][NFC] Update tests for GOTTPOFF relocation. Update tests for GOTTPOFF relocation as LEA instruction is not supported by linkers for GOTTPOFF relocation. Only MOV and ADD instructions are supported. --- llvm/test/MC/ELF/relocation.s | 2 +- llvm/test/MC/ELF/tls.s | 17 +++++++++-------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/llvm/test/MC/ELF/relocation.s b/llvm/test/MC/ELF/relocation.s index 25497a003f853..b84bdcc05dcf6 100644 --- a/llvm/test/MC/ELF/relocation.s +++ b/llvm/test/MC/ELF/relocation.s @@ -18,7 +18,7 @@ bar: movl bar, %edx # R_X86_64_32S movq bar, %rdx # R_X86_64_32S .long bar # R_X86_64_32 - leaq foo@GOTTPOFF(%rip), %rax # R_X86_64_GOTTPOFF + movq foo@GOTTPOFF(%rip), %rax # R_X86_64_GOTTPOFF movq foo@GOTTPOFF(%rip), %r31 # R_X86_64_CODE_4_GOTTPOFF addq foo@GOTTPOFF(%rip), %r31 # R_X86_64_CODE_4_GOTTPOFF # NDD diff --git a/llvm/test/MC/ELF/tls.s b/llvm/test/MC/ELF/tls.s index 560cf138806ec..9f3ff7c00b8d1 100644 --- a/llvm/test/MC/ELF/tls.s +++ b/llvm/test/MC/ELF/tls.s @@ -2,15 +2,16 @@ // Test that all symbols are of type STT_TLS. - leaq foo1@TLSGD(%rip), %rdi - leaq foo2@GOTTPOFF(%rip), %rdi - leaq foo3@TLSLD(%rip), %rdi - .long foo4@GOTTPOFF - .long foo5@TLSLD - .long foo6@TLSGD - .section .zed,"awT",@progbits + leaq foo1@TLSGD(%rip), %rdi + movq foo2@GOTTPOFF(%rip), %rdi + leaq foo3@TLSLD(%rip), %rdi + + .long foo4@GOTTPOFF + .long foo5@TLSLD + .long foo6@TLSGD + .section .zed,"awT",@progbits foobar: - .long 43 + .long 43 // CHECK: Symbol { // CHECK: Name: foobar