[PATCH] D22323: Set DT_MIPS_BASE_ADDRESS correctly if -image-base is given.
Rui Ueyama via llvm-commits
llvm-commits at lists.llvm.org
Thu Jul 14 10:47:42 PDT 2016
This revision was automatically updated to reflect the committed changes.
Closed by commit rL275446: Set DT_MIPS_BASE_ADDRESS correctly if -image-base is given. (authored by ruiu).
Changed prior to commit:
https://reviews.llvm.org/D22323?vs=63881&id=64008#toc
Repository:
rL LLVM
https://reviews.llvm.org/D22323
Files:
lld/trunk/ELF/OutputSections.cpp
lld/trunk/test/ELF/mips-dynamic.s
Index: lld/trunk/test/ELF/mips-dynamic.s
===================================================================
--- lld/trunk/test/ELF/mips-dynamic.s
+++ lld/trunk/test/ELF/mips-dynamic.s
@@ -8,6 +8,10 @@
# RUN: llvm-readobj -sections -dynamic-table %t.exe \
# RUN: | FileCheck -check-prefix=EXE %s
+# RUN: ld.lld %t.o --image-base=0x123000 %td.so -o %t.exe
+# RUN: llvm-readobj -sections -dynamic-table %t.exe \
+# RUN: | FileCheck -check-prefix=IMAGE_BASE %s
+
# RUN: ld.lld -shared %t.o %td.so -o %t.so
# RUN: llvm-readobj -sections -dyn-symbols -dynamic-table %t.so \
# RUN: | FileCheck -check-prefix=DSO %s
@@ -45,13 +49,15 @@
# EXE-DAG: 0x00000003 PLTGOT [[GOTADDR]]
# EXE-DAG: 0x70000001 MIPS_RLD_VERSION 1
# EXE-DAG: 0x70000005 MIPS_FLAGS NOTPOT
-# EXE-DAG: 0x70000006 MIPS_BASE_ADDRESS
+# EXE-DAG: 0x70000006 MIPS_BASE_ADDRESS 0x10000
# EXE-DAG: 0x7000000A MIPS_LOCAL_GOTNO 2
# EXE-DAG: 0x70000011 MIPS_SYMTABNO 2
# EXE-DAG: 0x70000013 MIPS_GOTSYM 0x2
# EXE-DAG: 0x70000016 MIPS_RLD_MAP [[RLDMAPADDR]]
# EXE: ]
+# IMAGE_BASE: 0x70000006 MIPS_BASE_ADDRESS 0x123000
+
# DSO: Sections [
# DSO: Name: .dynamic
# DSO-NEXT: Type: SHT_DYNAMIC
Index: lld/trunk/ELF/OutputSections.cpp
===================================================================
--- lld/trunk/ELF/OutputSections.cpp
+++ lld/trunk/ELF/OutputSections.cpp
@@ -724,7 +724,7 @@
if (Config->EMachine == EM_MIPS) {
Add({DT_MIPS_RLD_VERSION, 1});
Add({DT_MIPS_FLAGS, RHF_NOTPOT});
- Add({DT_MIPS_BASE_ADDRESS, (uintX_t)Target->getImageBase()});
+ Add({DT_MIPS_BASE_ADDRESS, Config->ImageBase});
Add({DT_MIPS_SYMTABNO, Out<ELFT>::DynSymTab->getNumSymbols()});
Add({DT_MIPS_LOCAL_GOTNO, Out<ELFT>::Got->getMipsLocalEntriesNum()});
if (const SymbolBody *B = Out<ELFT>::Got->getMipsFirstGlobalEntry())
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D22323.64008.patch
Type: text/x-patch
Size: 1933 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160714/31fdbc4a/attachment.bin>
More information about the llvm-commits
mailing list