Use 64 bits for the shared symbol size again.
authorRafael Espindola <rafael.espindola@gmail.com>
Mon, 30 Oct 2017 17:43:16 +0000 (17:43 +0000)
committerRafael Espindola <rafael.espindola@gmail.com>
Mon, 30 Oct 2017 17:43:16 +0000 (17:43 +0000)
We might want to drop support for such large symbols, but that should
be an explicit decision with a testcase.

llvm-svn: 316931

lld/ELF/Symbols.h
lld/test/ELF/Inputs/copy-rel-large.s [new file with mode: 0644]
lld/test/ELF/copy-rel-large.s [new file with mode: 0644]

index 0970354..ffedabd 100644 (file)
@@ -255,7 +255,7 @@ public:
   InputSection *CopyRelSec = nullptr;
 
   uint64_t Value; // st_value
-  uint32_t Size;  // st_size
+  uint64_t Size;  // st_size
   uint32_t Alignment;
 };
 
diff --git a/lld/test/ELF/Inputs/copy-rel-large.s b/lld/test/ELF/Inputs/copy-rel-large.s
new file mode 100644 (file)
index 0000000..8786a2f
--- /dev/null
@@ -0,0 +1,4 @@
+        .global foo
+        .type foo, @object
+foo:
+        .size foo, 0x100000001
diff --git a/lld/test/ELF/copy-rel-large.s b/lld/test/ELF/copy-rel-large.s
new file mode 100644 (file)
index 0000000..035eca3
--- /dev/null
@@ -0,0 +1,20 @@
+// REQUIRES: x86
+// RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %p/Inputs/copy-rel-large.s -o %t1.o
+// RUN: ld.lld -shared %t1.o -o %t1.so
+// RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t2.o
+// RUN: ld.lld %t2.o %t1.so -o %t2
+// RUN: llvm-readobj --dyn-symbols %t2 | FileCheck %s
+
+        .global _start
+_start:
+        .quad foo
+
+// CHECK:      Symbol {
+// CHECK:        Name: foo
+// CHECK-NEXT:   Value:
+// CHECK-NEXT:   Size: 4294967297
+// CHECK-NEXT:   Binding:
+// CHECK-NEXT:   Type:
+// CHECK-NEXT:   Other:
+// CHECK-NEXT:   Section:         .bss.rel.ro
+// CHECK-NEXT: }