[AArch64] ILP32 Backend Relocation Support
authorJoel Jones <joelkevinjones@gmail.com>
Tue, 2 May 2017 22:01:48 +0000 (22:01 +0000)
committerJoel Jones <joelkevinjones@gmail.com>
Tue, 2 May 2017 22:01:48 +0000 (22:01 +0000)
commit65134057357725c245fcfeb4b588518ef6d6db20
treea6ed3b45aed0932913cab1320331791a8150283a
parent93340741b80e5325418cd401f45fb320d19ba8e8
[AArch64] ILP32 Backend Relocation Support

Remove "_NC" suffix and semantics from TLSDESC_LD{64,32}_LO12 and
  TLSDESC_ADD_LO12 relocations
Rearrange ordering in AArch64.def to follow relocation encoding
Fix name:
  R_AARCH64_P32_LD64_GOT_LO12_NC => R_AARCH64_P32_LD32_GOT_LO12_NC
Add support for several "TLS", "TLSGD", and "TLSLD" relocations for
  ILP32
Fix return values from isNonILP32reloc
Add implementations for
  R_AARCH64_ADR_PREL_PG_HI21_NC, R_AARCH64_P32_LD32_GOT_LO12_NC,
  R_AARCH64_P32_TLSIE_LD32_GOTTPREL_LO12_NC,
  R_AARCH64_P32_TLSDESC_LD32_LO12, R_AARCH64_LD64_GOT_LO12_NC,
  *TLSLD_LDST128_DTPREL_LO12, *TLSLD_LDST128_DTPREL_LO12_NC,
  *TLSLE_LDST128_TPREL_LO12, *TLSLE_LDST128_TPREL_LO12_NC
Modify error messages to give name of equivalent relocation in the
  ABI not being used, along with better checking for non-existent
  requested relocations.
Added assembler support for "pg_hi21_nc"
Relocation definitions added without implementations:
  R_AARCH64_P32_TLSDESC_ADR_PREL21, R_AARCH64_P32_TLSGD_ADR_PREL21,
  R_AARCH64_P32_TLSGD_ADD_LO12_NC, R_AARCH64_P32_TLSLD_ADR_PREL21,
  R_AARCH64_P32_TLSLD_ADR_PAGE21, R_AARCH64_P32_TLSLD_ADD_LO12_NC,
  R_AARCH64_P32_TLSLD_LD_PREL19, R_AARCH64_P32_TLSDESC_LD_PREL19,
  R_AARCH64_P32_TLSGD_ADR_PAGE21, R_AARCH64_P32_TLS_DTPREL,
  R_AARCH64_P32_TLS_DTPMOD, R_AARCH64_P32_TLS_TPREL,
  R_AARCH64_P32_TLSDESC
Fix encoding:
  R_AARCH64_P32_TLSDESC_ADR_PAGE21

Reviewers: Peter Smith

Patch by: Joel Jones (jjones@cavium.com)

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

llvm-svn: 301980
19 files changed:
llvm/include/llvm/Support/ELFRelocs/AArch64.def
llvm/lib/Target/AArch64/AArch64AsmPrinter.cpp
llvm/lib/Target/AArch64/MCTargetDesc/AArch64ELFObjectWriter.cpp
llvm/lib/Target/AArch64/MCTargetDesc/AArch64MCExpr.cpp
llvm/lib/Target/AArch64/MCTargetDesc/AArch64MCExpr.h
llvm/test/CodeGen/AArch64/arm64-tls-dynamics.ll
llvm/test/MC/AArch64/adrp-relocation.s
llvm/test/MC/AArch64/arm32-elf-relocs.s
llvm/test/MC/AArch64/arm64-elf-reloc-condbr.s
llvm/test/MC/AArch64/arm64-elf-relocs.s
llvm/test/MC/AArch64/arm64-tls-relocs.s
llvm/test/MC/AArch64/elf-reloc-ldrlit.s
llvm/test/MC/AArch64/elf-reloc-tstb.s
llvm/test/MC/AArch64/elf-reloc-uncondbrimm.s
llvm/test/MC/AArch64/error-location.s
llvm/test/MC/AArch64/ilp32-diagnostics.s
llvm/test/MC/AArch64/inline-asm-modifiers.s
llvm/test/MC/AArch64/tls-relocs.s
llvm/test/tools/llvm-readobj/reloc-types.test