summaryrefslogtreecommitdiffstats
path: root/lld/lib/ReaderWriter/ELF/Mips/MipsLinkingContext.cpp
diff options
context:
space:
mode:
authorSimon Atanasyan <simon@atanasyan.com>2014-04-29 05:21:54 +0000
committerSimon Atanasyan <simon@atanasyan.com>2014-04-29 05:21:54 +0000
commit8de2b8fb81ba8ded01f3b1a04edbc6550e65a435 (patch)
treea0a3d01fbadd938d67e2a2232e08d61c95a7e2b4 /lld/lib/ReaderWriter/ELF/Mips/MipsLinkingContext.cpp
parentf293b3e52c57735bdcc2b9520d372ded86149ef6 (diff)
downloadbcm5719-llvm-8de2b8fb81ba8ded01f3b1a04edbc6550e65a435.tar.gz
bcm5719-llvm-8de2b8fb81ba8ded01f3b1a04edbc6550e65a435.zip
[Mips] Implement emitting of R_MIPS_REL32 relocations:
1. Re-implement PLT entries and dynamic relocations emitting to keep PLT and relocations table in a consistent state. 2. Initialize st_value and st_other fields for dynamic symbols table entry if this entry corresponds to an external function which address is taken in a non-PIC executable. In that case the st_value field holds an address of the function's PLT entry. Also set STO_MIPS_PLT bit in the st_other field. llvm-svn: 207494
Diffstat (limited to 'lld/lib/ReaderWriter/ELF/Mips/MipsLinkingContext.cpp')
-rw-r--r--lld/lib/ReaderWriter/ELF/Mips/MipsLinkingContext.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/lld/lib/ReaderWriter/ELF/Mips/MipsLinkingContext.cpp b/lld/lib/ReaderWriter/ELF/Mips/MipsLinkingContext.cpp
index e2c290e27f8..b4f73ed6459 100644
--- a/lld/lib/ReaderWriter/ELF/Mips/MipsLinkingContext.cpp
+++ b/lld/lib/ReaderWriter/ELF/Mips/MipsLinkingContext.cpp
@@ -50,7 +50,14 @@ bool MipsLinkingContext::isDynamicRelocation(const DefinedAtom &,
const Reference &r) const {
if (r.kindNamespace() != Reference::KindNamespace::ELF)
return false;
- return r.kindValue() == llvm::ELF::R_MIPS_COPY;
+ assert(r.kindArch() == Reference::KindArch::Mips);
+ switch (r.kindValue()) {
+ case llvm::ELF::R_MIPS_COPY:
+ case llvm::ELF::R_MIPS_REL32:
+ return true;
+ default:
+ return false;
+ }
}
bool MipsLinkingContext::isPLTRelocation(const DefinedAtom &,
OpenPOWER on IntegriCloud