[lld] r174199 - add alignment to .got/.got.plt/.plt sections & fix tests
Shankar Easwaran
shankare at codeaurora.org
Fri Feb 1 10:03:32 PST 2013
Author: shankare
Date: Fri Feb 1 12:03:32 2013
New Revision: 174199
URL: http://llvm.org/viewvc/llvm-project?rev=174199&view=rev
Log:
add alignment to .got/.got.plt/.plt sections & fix tests
Modified:
lld/trunk/lib/ReaderWriter/ELF/X86_64/X86_64TargetHandler.cpp
lld/trunk/lib/ReaderWriter/ELF/X86_64/X86_64TargetInfo.cpp
lld/trunk/test/elf/ifunc.test
Modified: lld/trunk/lib/ReaderWriter/ELF/X86_64/X86_64TargetHandler.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/X86_64/X86_64TargetHandler.cpp?rev=174199&r1=174198&r2=174199&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/ELF/X86_64/X86_64TargetHandler.cpp (original)
+++ lld/trunk/lib/ReaderWriter/ELF/X86_64/X86_64TargetHandler.cpp Fri Feb 1 12:03:32 2013
@@ -134,6 +134,11 @@ public:
virtual ContentPermissions permissions() const { return permRW_; }
+ virtual Alignment alignment() const {
+ // Needs 8 byte alignment
+ return Alignment(3);
+ }
+
virtual ArrayRef<uint8_t> rawContent() const {
return ArrayRef<uint8_t>();
}
Modified: lld/trunk/lib/ReaderWriter/ELF/X86_64/X86_64TargetInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/X86_64/X86_64TargetInfo.cpp?rev=174199&r1=174198&r2=174199&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/ELF/X86_64/X86_64TargetInfo.cpp (original)
+++ lld/trunk/lib/ReaderWriter/ELF/X86_64/X86_64TargetInfo.cpp Fri Feb 1 12:03:32 2013
@@ -48,6 +48,11 @@ public:
return ArrayRef<uint8_t>(_defaultContent, 8);
}
+ virtual Alignment alignment() const {
+ // The alignment should be 8 byte aligned
+ return Alignment(3);
+ }
+
#ifndef NDEBUG
virtual StringRef name() const { return _name; }
@@ -84,6 +89,11 @@ public:
return ArrayRef<uint8_t>(_defaultContent, 16);
}
+ virtual Alignment alignment() const {
+ // The alignment should be 4 byte aligned
+ return Alignment(2);
+ }
+
#ifndef NDEBUG
virtual StringRef name() const { return _name; }
Modified: lld/trunk/test/elf/ifunc.test
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/elf/ifunc.test?rev=174199&r1=174198&r2=174199&view=diff
==============================================================================
--- lld/trunk/test/elf/ifunc.test (original)
+++ lld/trunk/test/elf/ifunc.test Fri Feb 1 12:03:32 2013
@@ -5,7 +5,7 @@ RUN: lld -core -target x86_64-linux -emi
RUN: %p/Inputs/ifunc.cpp.x86-64 | FileCheck %s --check-prefix=PLT
RUN: lld -core -target x86_64-linux -output=%t %p/Inputs/ifunc.x86-64 \
-RUN: %p/Inputs/ifunc.cpp.x86-64 && llvm-objdump -d %t| FileCheck %s \
+RUN: -noinhibit-exec %p/Inputs/ifunc.cpp.x86-64 && llvm-objdump -d -s %t| FileCheck %s \
RUN: --check-prefix=BIN
CHECK: name: hey
@@ -33,6 +33,6 @@ PLT: kind: R_X86_64_PC32
// This is a horribly brittle test. We need a way to do arithmetic on captured
// variables.
-BIN: 400136: ff 25 c4 0e 00 00 jumpq *3780(%rip)
+BIN: 40011c: ff 25 de 0e 00 00 jmpq *3806(%rip)
BIN: .got.plt:
BIN-NEXT: 401000 00000000 00000000
More information about the llvm-commits
mailing list