From 458173e8022d449f5b9c8fdd30377b394a494359 Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Mon, 30 Oct 2017 17:43:16 +0000 Subject: [PATCH] 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. llvm-svn: 316931 --- lld/ELF/Symbols.h | 2 +- lld/test/ELF/Inputs/copy-rel-large.s | 4 ++++ lld/test/ELF/copy-rel-large.s | 20 ++++++++++++++++++++ 3 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 lld/test/ELF/Inputs/copy-rel-large.s create mode 100644 lld/test/ELF/copy-rel-large.s diff --git a/lld/ELF/Symbols.h b/lld/ELF/Symbols.h index 0970354..ffedabd 100644 --- a/lld/ELF/Symbols.h +++ b/lld/ELF/Symbols.h @@ -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 index 0000000..8786a2f --- /dev/null +++ b/lld/test/ELF/Inputs/copy-rel-large.s @@ -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 index 0000000..035eca3 --- /dev/null +++ b/lld/test/ELF/copy-rel-large.s @@ -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: } -- 2.7.4