[ELF][MIPS] Support linking of PIE for MIPS
authorSimon Atanasyan <simon@atanasyan.com>
Fri, 13 Apr 2018 08:15:01 +0000 (08:15 +0000)
committerSimon Atanasyan <simon@atanasyan.com>
Fri, 13 Apr 2018 08:15:01 +0000 (08:15 +0000)
commit1ba194212a948fe4664ed7caedc7637968a7dbc7
tree5ef18a86de79e2864091d7e472e4bf98fbb022da
parent6325619d0b21e974d68b84e293ca2792b3f59958
[ELF][MIPS] Support linking of PIE for MIPS

MIPS ABI requires creation of the MIPS_RLD_MAP dynamic tag for non-PIE
executables only and MIPS_RLD_MAP_REL tag for both PIE and non-PIE
executables. The patch skips definition of the MIPS_RLD_MAP for PIE
files and defines MIPS_RLD_MAP_REL.

The MIPS_RLD_MAP_REL tag stores the offset to the .rld_map section
relative to the address of the tag itself.

Differential Revision: https://reviews.llvm.org/D43347

llvm-svn: 329996
lld/ELF/SyntheticSections.cpp
lld/ELF/SyntheticSections.h
lld/test/ELF/mips-dynamic.s