[lld] r177969 - [ELF] order rela.dyn/rela.plt properly
Shankar Easwaran
shankare at codeaurora.org
Mon Mar 25 19:20:08 PDT 2013
Author: shankare
Date: Mon Mar 25 21:20:08 2013
New Revision: 177969
URL: http://llvm.org/viewvc/llvm-project?rev=177969&view=rev
Log:
[ELF] order rela.dyn/rela.plt properly
Added:
lld/trunk/test/elf/Hexagon/Inputs/dynobj.c
lld/trunk/test/elf/Hexagon/Inputs/dynobj.o (with props)
lld/trunk/test/elf/Hexagon/rela-order.test
Modified:
lld/trunk/lib/ReaderWriter/ELF/DefaultLayout.h
Modified: lld/trunk/lib/ReaderWriter/ELF/DefaultLayout.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/DefaultLayout.h?rev=177969&r1=177968&r2=177969&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/ELF/DefaultLayout.h (original)
+++ lld/trunk/lib/ReaderWriter/ELF/DefaultLayout.h Mon Mar 25 21:20:08 2013
@@ -259,7 +259,7 @@ public:
RelocationTable<ELFT> *getDynamicRelocationTable() {
if (!_dynamicRelocationTable) {
_dynamicRelocationTable.reset(new (_allocator) RelocationTable<ELFT>(
- _targetInfo, ".rela.dyn", ORDER_REL));
+ _targetInfo, ".rela.dyn", ORDER_DYNAMIC_RELOCS));
addSection(_dynamicRelocationTable.get());
}
return _dynamicRelocationTable.get();
@@ -269,7 +269,7 @@ public:
RelocationTable<ELFT> *getPLTRelocationTable() {
if (!_pltRelocationTable) {
_pltRelocationTable.reset(new (_allocator) RelocationTable<ELFT>(
- _targetInfo, ".rela.plt", ORDER_REL));
+ _targetInfo, ".rela.plt", ORDER_DYNAMIC_PLT_RELOCS));
addSection(_pltRelocationTable.get());
}
return _pltRelocationTable.get();
@@ -386,6 +386,8 @@ Layout::SegmentType DefaultLayout<ELFT>:
case ORDER_HASH:
case ORDER_DYNAMIC_SYMBOLS:
case ORDER_DYNAMIC_STRINGS:
+ case ORDER_DYNAMIC_RELOCS:
+ case ORDER_DYNAMIC_PLT_RELOCS:
case ORDER_REL:
case ORDER_INIT:
case ORDER_PLT:
@@ -429,6 +431,8 @@ bool DefaultLayout<ELFT>::hasOutputSegme
case ORDER_HASH:
case ORDER_DYNAMIC_SYMBOLS:
case ORDER_DYNAMIC_STRINGS:
+ case ORDER_DYNAMIC_RELOCS:
+ case ORDER_DYNAMIC_PLT_RELOCS:
case ORDER_REL:
case ORDER_INIT:
case ORDER_PLT:
Added: lld/trunk/test/elf/Hexagon/Inputs/dynobj.c
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/elf/Hexagon/Inputs/dynobj.c?rev=177969&view=auto
==============================================================================
--- lld/trunk/test/elf/Hexagon/Inputs/dynobj.c (added)
+++ lld/trunk/test/elf/Hexagon/Inputs/dynobj.c Mon Mar 25 21:20:08 2013
@@ -0,0 +1,26 @@
+extern int shankar;
+static int a;
+static int b;
+int c;
+int fn2() {
+ return 0;
+}
+
+int fn1() {
+ return 0;
+}
+
+int fn() {
+ a = 10;
+ b = 20;
+ c = 10;
+ shankar = 20;
+ return 0;
+}
+
+int fn3() {
+ fn();
+ fn1();
+ fn2();
+ return 0;
+}
Added: lld/trunk/test/elf/Hexagon/Inputs/dynobj.o
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/elf/Hexagon/Inputs/dynobj.o?rev=177969&view=auto
==============================================================================
Binary file - no diff available.
Propchange: lld/trunk/test/elf/Hexagon/Inputs/dynobj.o
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: lld/trunk/test/elf/Hexagon/rela-order.test
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/elf/Hexagon/rela-order.test?rev=177969&view=auto
==============================================================================
--- lld/trunk/test/elf/Hexagon/rela-order.test (added)
+++ lld/trunk/test/elf/Hexagon/rela-order.test Mon Mar 25 21:20:08 2013
@@ -0,0 +1,9 @@
+RUN: lld -core -target hexagon %p/Inputs/dynobj.o \
+RUN: -output=%t -noinhibit-exec -output-type=shared
+RUN: llvm-objdump -section-headers %t | FileCheck %s
+
+CHECK: .dynsym
+CHECK-NEXT: .dynstr
+CHECK-NEXT: .rela.dyn
+CHECK-NEXT: .rela.plt
+CHECK-NEXT: .plt
More information about the llvm-commits
mailing list