[lld] r320995 - Add a test.
Rafael Espindola via llvm-commits
llvm-commits at lists.llvm.org
Mon Dec 18 09:36:28 PST 2017
Author: rafael
Date: Mon Dec 18 09:36:28 2017
New Revision: 320995
URL: http://llvm.org/viewvc/llvm-project?rev=320995&view=rev
Log:
Add a test.
This changed in r315658, but it was missing a test.
Added:
lld/trunk/test/ELF/i386-got-value.s
Added: lld/trunk/test/ELF/i386-got-value.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/i386-got-value.s?rev=320995&view=auto
==============================================================================
--- lld/trunk/test/ELF/i386-got-value.s (added)
+++ lld/trunk/test/ELF/i386-got-value.s Mon Dec 18 09:36:28 2017
@@ -0,0 +1,36 @@
+# RUN: llvm-mc %s -o %t.o -filetype=obj -triple=i386-pc-linux
+# RUN: ld.lld %t.o -o %t.so -shared
+# RUN: llvm-readobj --relocations --symbols --sections --section-data %t.so | FileCheck %s
+
+# Check that the value of a preemptible symbol is written to the got
+# entry when using Elf_Rel. It is not clear why that is required, but
+# freebsd i386 seems to depend on it.
+
+# CHECK: Name: .got
+# CHECK-NEXT: Type: SHT_PROGBITS
+# CHECK-NEXT: Flags [
+# CHECK-NEXT: SHF_ALLOC
+# CHECK-NEXT: SHF_WRITE
+# CHECK-NEXT: ]
+# CHECK-NEXT: Address:
+# CHECK-NEXT: Offset:
+# CHECK-NEXT: Size: 4
+# CHECK-NEXT: Link:
+# CHECK-NEXT: Info:
+# CHECK-NEXT: AddressAlignment:
+# CHECK-NEXT: EntrySize:
+# CHECK-NEXT: SectionData (
+# CHECK-NEXT: 0000: 00200000
+# CHECK-NEXT: )
+
+# CHECK: R_386_GLOB_DAT bar 0x0
+
+# CHECK: Name: bar
+# CHECK-NEXT: Value: 0x2000
+
+ movl bar at GOT(%eax), %eax
+
+ .data
+ .globl bar
+bar:
+ .long 42
More information about the llvm-commits
mailing list