[PATCH] D21606: [ELF][MIPS] Support MIPS TLS relocations

Simon Atanasyan via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 22 05:34:57 PDT 2016


atanasyan created this revision.
atanasyan added reviewers: rafael, 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.

The patch adds one more partition to the MIPS GOT. This time it is for TLS related GOT entries. Such entries are located after 'local' and 'global' ones. We cannot get a final offset for these entries at the time of creation because we do not know size of 'local' and 'global' partitions. So we have to adjust the offset later using `getMipsTlsOffset()` method.

All MIPS TLS relocations which need GOT entries operates MIPS style GOT offset - 'offset from the GOT's beginning' - MipsGPOffset constant. That is why I add new types of relocation expressions.

One more difference from othe ABIs is that the MIPS ABI does not support any TLS relocation relaxations. I decided to make a separate function `handleMipsTlsRelocation` and put MIPS TLS relocation handling code there. It is similar to `handleTlsRelocation` routine and duplicates its code. But it allows to make the code cleaner and prevent pollution of the `handleTlsRelocation` by MIPS 'if' statements.

Repository:
  rL LLVM

http://reviews.llvm.org/D21606

Files:
  ELF/InputSection.cpp
  ELF/OutputSections.cpp
  ELF/OutputSections.h
  ELF/Relocations.cpp
  ELF/Relocations.h
  ELF/Target.cpp
  test/ELF/Inputs/mips-tls.s
  test/ELF/mips-tls-64.s
  test/ELF/mips-tls.s

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D21606.61535.patch
Type: text/x-patch
Size: 16634 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160622/0839146b/attachment.bin>


More information about the llvm-commits mailing list