[lld] r316931 - Use 64 bits for the shared symbol size again.

Rafael Espindola via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 30 10:43:17 PDT 2017


Author: rafael
Date: Mon Oct 30 10:43:16 2017
New Revision: 316931

URL: http://llvm.org/viewvc/llvm-project?rev=316931&view=rev
Log:
Use 64 bits for the shared symbol size again.

We might want to drop support for such large symbols, but that should
be an explicit decision with a testcase.

Added:
    lld/trunk/test/ELF/Inputs/copy-rel-large.s
    lld/trunk/test/ELF/copy-rel-large.s
Modified:
    lld/trunk/ELF/Symbols.h

Modified: lld/trunk/ELF/Symbols.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Symbols.h?rev=316931&r1=316930&r2=316931&view=diff
==============================================================================
--- lld/trunk/ELF/Symbols.h (original)
+++ lld/trunk/ELF/Symbols.h Mon Oct 30 10:43:16 2017
@@ -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;
 };
 

Added: lld/trunk/test/ELF/Inputs/copy-rel-large.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/Inputs/copy-rel-large.s?rev=316931&view=auto
==============================================================================
--- lld/trunk/test/ELF/Inputs/copy-rel-large.s (added)
+++ lld/trunk/test/ELF/Inputs/copy-rel-large.s Mon Oct 30 10:43:16 2017
@@ -0,0 +1,4 @@
+        .global foo
+        .type foo, @object
+foo:
+        .size foo, 0x100000001

Added: lld/trunk/test/ELF/copy-rel-large.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/copy-rel-large.s?rev=316931&view=auto
==============================================================================
--- lld/trunk/test/ELF/copy-rel-large.s (added)
+++ lld/trunk/test/ELF/copy-rel-large.s Mon Oct 30 10:43:16 2017
@@ -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: }




More information about the llvm-commits mailing list