summaryrefslogtreecommitdiff
path: root/lld/ELF/Writer.h
diff options
context:
space:
mode:
authorSimon Atanasyan <simon@atanasyan.com>2016-11-05 22:58:01 +0000
committerSimon Atanasyan <simon@atanasyan.com>2016-11-05 22:58:01 +0000
commit9a8df35489077cca6bd5591773a08197afbfa10e (patch)
tree088e65d5ec61fbf7ec9c90ac4376a513abd18cbf /lld/ELF/Writer.h
parent00ef414abe45280e4fc9e31c70198ee5a6ef9417 (diff)
[ELF][MIPS] N32 ABI support
In short the patch introduces support for linking object file conform MIPS N32 ABI [1]. This ABI is similar to N64 ABI but uses 32-bit pointer size. The most non-trivial requirement of this ABI is one more relocation packing format. N64 ABI puts multiple relocation type into the single relocation record. The N32 ABI uses series of successive relocations with the same offset for this purpose. In this patch, new function `mergeMipsN32RelTypes` handle this case and "convert" N32 relocation to the N64 relocation so the rest of the code keep unchanged. For now, linker does not support series of relocations applied to sections without SHF_ALLOC bit. Probably later I will add the support or insert some sort of assert into the `relocateNonAlloc` routine to catch this case. [1] ftp://www.linux-mips.org/pub/linux/mips/doc/ABI/MIPS-N32-ABI-Handbook.pdf Differential revision: https://reviews.llvm.org/D26298
Diffstat (limited to 'lld/ELF/Writer.h')
-rw-r--r--lld/ELF/Writer.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/lld/ELF/Writer.h b/lld/ELF/Writer.h
index b0d60b40077..3b6c6e52de2 100644
--- a/lld/ELF/Writer.h
+++ b/lld/ELF/Writer.h
@@ -16,6 +16,7 @@
namespace lld {
namespace elf {
+class InputFile;
template <class ELFT> class OutputSectionBase;
template <class ELFT> class InputSectionBase;
template <class ELFT> class ObjectFile;
@@ -45,6 +46,8 @@ template <class ELFT> uint32_t getMipsEFlags();
uint8_t getMipsFpAbiFlag(uint8_t OldFlag, uint8_t NewFlag,
llvm::StringRef FileName);
+
+bool isMipsN32Abi(const InputFile *F);
}
}