[PATCH] D26298: [ELF][MIPS] N32 ABI support

Simon Atanasyan via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 4 11:07:28 PDT 2016


atanasyan created this revision.
atanasyan added a reviewer: ruiu.
atanasyan added a subscriber: llvm-commits.
atanasyan set the repository for this revision to rL LLVM.
atanasyan added a project: lld.
Herald added a subscriber: sdardis.

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


Repository:
  rL LLVM

https://reviews.llvm.org/D26298

Files:
  ELF/Config.h
  ELF/Driver.cpp
  ELF/Relocations.cpp
  ELF/Target.cpp
  test/ELF/Inputs/mips-n32-rels.o
  test/ELF/mips-n32-emul.s
  test/ELF/mips-n32-rels.s

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D26298.76915.patch
Type: text/x-patch
Size: 10107 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20161104/263aea94/attachment.bin>


More information about the llvm-commits mailing list