Index: vendor/lld/lld-release_390-r280324/ELF/Target.cpp =================================================================== --- vendor/lld/lld-release_390-r280324/ELF/Target.cpp (nonexistent) +++ vendor/lld/lld-release_390-r280324/ELF/Target.cpp (revision 305296) @@ -0,0 +1,2120 @@ +//===- Target.cpp ---------------------------------------------------------===// +// +// The LLVM Linker +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// +// Machine-specific things, such as applying relocations, creation of +// GOT or PLT entries, etc., are handled in this file. +// +// Refer the ELF spec for the single letter varaibles, S, A or P, used +// in this file. +// +// Some functions defined in this file has "relaxTls" as part of their names. +// They do peephole optimization for TLS variables by rewriting instructions. +// They are not part of the ABI but optional optimization, so you can skip +// them if you are not interested in how TLS variables are optimized. +// See the following paper for the details. +// +// Ulrich Drepper, ELF Handling For Thread-Local Storage +// http://www.akkadia.org/drepper/tls.pdf +// +//===----------------------------------------------------------------------===// + +#include "Target.h" +#include "Error.h" +#include "InputFiles.h" +#include "OutputSections.h" +#include "Symbols.h" +#include "Thunks.h" + +#include "llvm/ADT/ArrayRef.h" +#include "llvm/Object/ELF.h" +#include "llvm/Support/Endian.h" +#include "llvm/Support/ELF.h" + +using namespace llvm; +using namespace llvm::object; +using namespace llvm::support::endian; +using namespace llvm::ELF; + +namespace lld { +namespace elf { + +TargetInfo *Target; + +static void or32le(uint8_t *P, int32_t V) { write32le(P, read32le(P) | V); } + +StringRef getRelName(uint32_t Type) { + return getELFRelocationTypeName(Config->EMachine, Type); +} + +template static void checkInt(int64_t V, uint32_t Type) { + if (!isInt(V)) + error("relocation " + getRelName(Type) + " out of range"); +} + +template static void checkUInt(uint64_t V, uint32_t Type) { + if (!isUInt(V)) + error("relocation " + getRelName(Type) + " out of range"); +} + +template static void checkIntUInt(uint64_t V, uint32_t Type) { + if (!isInt(V) && !isUInt(V)) + error("relocation " + getRelName(Type) + " out of range"); +} + +template static void checkAlignment(uint64_t V, uint32_t Type) { + if ((V & (N - 1)) != 0) + error("improper alignment for relocation " + getRelName(Type)); +} + +static void errorDynRel(uint32_t Type) { + error("relocation " + getRelName(Type) + + " cannot be used against shared object; recompile with -fPIC."); +} + +namespace { +class X86TargetInfo final : public TargetInfo { +public: + X86TargetInfo(); + RelExpr getRelExpr(uint32_t Type, const SymbolBody &S) const override; + uint64_t getImplicitAddend(const uint8_t *Buf, uint32_t Type) const override; + void writeGotPltHeader(uint8_t *Buf) const override; + uint32_t getDynRel(uint32_t Type) const override; + bool isTlsLocalDynamicRel(uint32_t Type) const override; + bool isTlsGlobalDynamicRel(uint32_t Type) const override; + bool isTlsInitialExecRel(uint32_t Type) const override; + void writeGotPlt(uint8_t *Buf, const SymbolBody &S) const override; + void writePltHeader(uint8_t *Buf) const override; + void writePlt(uint8_t *Buf, uint64_t GotEntryAddr, uint64_t PltEntryAddr, + int32_t Index, unsigned RelOff) const override; + void relocateOne(uint8_t *Loc, uint32_t Type, uint64_t Val) const override; + + RelExpr adjustRelaxExpr(uint32_t Type, const uint8_t *Data, + RelExpr Expr) const override; + void relaxTlsGdToIe(uint8_t *Loc, uint32_t Type, uint64_t Val) const override; + void relaxTlsGdToLe(uint8_t *Loc, uint32_t Type, uint64_t Val) const override; + void relaxTlsIeToLe(uint8_t *Loc, uint32_t Type, uint64_t Val) const override; + void relaxTlsLdToLe(uint8_t *Loc, uint32_t Type, uint64_t Val) const override; +}; + +template class X86_64TargetInfo final : public TargetInfo { +public: + X86_64TargetInfo(); + RelExpr getRelExpr(uint32_t Type, const SymbolBody &S) const override; + uint32_t getDynRel(uint32_t Type) const override; + bool isTlsLocalDynamicRel(uint32_t Type) const override; + bool isTlsGlobalDynamicRel(uint32_t Type) const override; + bool isTlsInitialExecRel(uint32_t Type) const override; + void writeGotPltHeader(uint8_t *Buf) const override; + void writeGotPlt(uint8_t *Buf, const SymbolBody &S) const override; + void writePltHeader(uint8_t *Buf) const override; + void writePlt(uint8_t *Buf, uint64_t GotEntryAddr, uint64_t PltEntryAddr, + int32_t Index, unsigned RelOff) const override; + void relocateOne(uint8_t *Loc, uint32_t Type, uint64_t Val) const override; + + RelExpr adjustRelaxExpr(uint32_t Type, const uint8_t *Data, + RelExpr Expr) const override; + void relaxGot(uint8_t *Loc, uint64_t Val) const override; + void relaxTlsGdToIe(uint8_t *Loc, uint32_t Type, uint64_t Val) const override; + void relaxTlsGdToLe(uint8_t *Loc, uint32_t Type, uint64_t Val) const override; + void relaxTlsIeToLe(uint8_t *Loc, uint32_t Type, uint64_t Val) const override; + void relaxTlsLdToLe(uint8_t *Loc, uint32_t Type, uint64_t Val) const override; + +private: + void relaxGotNoPic(uint8_t *Loc, uint64_t Val, uint8_t Op, + uint8_t ModRm) const; +}; + +class PPCTargetInfo final : public TargetInfo { +public: + PPCTargetInfo(); + void relocateOne(uint8_t *Loc, uint32_t Type, uint64_t Val) const override; + RelExpr getRelExpr(uint32_t Type, const SymbolBody &S) const override; +}; + +class PPC64TargetInfo final : public TargetInfo { +public: + PPC64TargetInfo(); + RelExpr getRelExpr(uint32_t Type, const SymbolBody &S) const override; + void writePlt(uint8_t *Buf, uint64_t GotEntryAddr, uint64_t PltEntryAddr, + int32_t Index, unsigned RelOff) const override; + void relocateOne(uint8_t *Loc, uint32_t Type, uint64_t Val) const override; +}; + +class AArch64TargetInfo final : public TargetInfo { +public: + AArch64TargetInfo(); + RelExpr getRelExpr(uint32_t Type, const SymbolBody &S) const override; + uint32_t getDynRel(uint32_t Type) const override; + bool isTlsInitialExecRel(uint32_t Type) const override; + void writeGotPlt(uint8_t *Buf, const SymbolBody &S) const override; + void writePltHeader(uint8_t *Buf) const override; + void writePlt(uint8_t *Buf, uint64_t GotEntryAddr, uint64_t PltEntryAddr, + int32_t Index, unsigned RelOff) const override; + bool usesOnlyLowPageBits(uint32_t Type) const override; + void relocateOne(uint8_t *Loc, uint32_t Type, uint64_t Val) const override; + RelExpr adjustRelaxExpr(uint32_t Type, const uint8_t *Data, + RelExpr Expr) const override; + void relaxTlsGdToLe(uint8_t *Loc, uint32_t Type, uint64_t Val) const override; + void relaxTlsGdToIe(uint8_t *Loc, uint32_t Type, uint64_t Val) const override; + void relaxTlsIeToLe(uint8_t *Loc, uint32_t Type, uint64_t Val) const override; +}; + +class AMDGPUTargetInfo final : public TargetInfo { +public: + AMDGPUTargetInfo(); + void relocateOne(uint8_t *Loc, uint32_t Type, uint64_t Val) const override; + RelExpr getRelExpr(uint32_t Type, const SymbolBody &S) const override; +}; + +class ARMTargetInfo final : public TargetInfo { +public: + ARMTargetInfo(); + RelExpr getRelExpr(uint32_t Type, const SymbolBody &S) const override; + uint32_t getDynRel(uint32_t Type) const override; + uint64_t getImplicitAddend(const uint8_t *Buf, uint32_t Type) const override; + void writeGotPlt(uint8_t *Buf, const SymbolBody &S) const override; + void writePltHeader(uint8_t *Buf) const override; + void writePlt(uint8_t *Buf, uint64_t GotEntryAddr, uint64_t PltEntryAddr, + int32_t Index, unsigned RelOff) const override; + RelExpr getThunkExpr(RelExpr Expr, uint32_t RelocType, + const InputFile &File, + const SymbolBody &S) const override; + void relocateOne(uint8_t *Loc, uint32_t Type, uint64_t Val) const override; +}; + +template class MipsTargetInfo final : public TargetInfo { +public: + MipsTargetInfo(); + RelExpr getRelExpr(uint32_t Type, const SymbolBody &S) const override; + uint64_t getImplicitAddend(const uint8_t *Buf, uint32_t Type) const override; + uint32_t getDynRel(uint32_t Type) const override; + bool isTlsLocalDynamicRel(uint32_t Type) const override; + bool isTlsGlobalDynamicRel(uint32_t Type) const override; + void writeGotPlt(uint8_t *Buf, const SymbolBody &S) const override; + void writePltHeader(uint8_t *Buf) const override; + void writePlt(uint8_t *Buf, uint64_t GotEntryAddr, uint64_t PltEntryAddr, + int32_t Index, unsigned RelOff) const override; + RelExpr getThunkExpr(RelExpr Expr, uint32_t RelocType, + const InputFile &File, + const SymbolBody &S) const override; + void relocateOne(uint8_t *Loc, uint32_t Type, uint64_t Val) const override; + bool usesOnlyLowPageBits(uint32_t Type) const override; +}; +} // anonymous namespace + +TargetInfo *createTarget() { + switch (Config->EMachine) { + case EM_386: + return new X86TargetInfo(); + case EM_AARCH64: + return new AArch64TargetInfo(); + case EM_AMDGPU: + return new AMDGPUTargetInfo(); + case EM_ARM: + return new ARMTargetInfo(); + case EM_MIPS: + switch (Config->EKind) { + case ELF32LEKind: + return new MipsTargetInfo(); + case ELF32BEKind: + return new MipsTargetInfo(); + case ELF64LEKind: + return new MipsTargetInfo(); + case ELF64BEKind: + return new MipsTargetInfo(); + default: + fatal("unsupported MIPS target"); + } + case EM_PPC: + return new PPCTargetInfo(); + case EM_PPC64: + return new PPC64TargetInfo(); + case EM_X86_64: + if (Config->EKind == ELF32LEKind) + return new X86_64TargetInfo(); + return new X86_64TargetInfo(); + } + fatal("unknown target machine"); +} + +TargetInfo::~TargetInfo() {} + +uint64_t TargetInfo::getImplicitAddend(const uint8_t *Buf, + uint32_t Type) const { + return 0; +} + +bool TargetInfo::usesOnlyLowPageBits(uint32_t Type) const { return false; } + +RelExpr TargetInfo::getThunkExpr(RelExpr Expr, uint32_t RelocType, + const InputFile &File, + const SymbolBody &S) const { + return Expr; +} + +bool TargetInfo::isTlsInitialExecRel(uint32_t Type) const { return false; } + +bool TargetInfo::isTlsLocalDynamicRel(uint32_t Type) const { return false; } + +bool TargetInfo::isTlsGlobalDynamicRel(uint32_t Type) const { + return false; +} + +RelExpr TargetInfo::adjustRelaxExpr(uint32_t Type, const uint8_t *Data, + RelExpr Expr) const { + return Expr; +} + +void TargetInfo::relaxGot(uint8_t *Loc, uint64_t Val) const { + llvm_unreachable("Should not have claimed to be relaxable"); +} + +void TargetInfo::relaxTlsGdToLe(uint8_t *Loc, uint32_t Type, + uint64_t Val) const { + llvm_unreachable("Should not have claimed to be relaxable"); +} + +void TargetInfo::relaxTlsGdToIe(uint8_t *Loc, uint32_t Type, + uint64_t Val) const { + llvm_unreachable("Should not have claimed to be relaxable"); +} + +void TargetInfo::relaxTlsIeToLe(uint8_t *Loc, uint32_t Type, + uint64_t Val) const { + llvm_unreachable("Should not have claimed to be relaxable"); +} + +void TargetInfo::relaxTlsLdToLe(uint8_t *Loc, uint32_t Type, + uint64_t Val) const { + llvm_unreachable("Should not have claimed to be relaxable"); +} + +X86TargetInfo::X86TargetInfo() { + CopyRel = R_386_COPY; + GotRel = R_386_GLOB_DAT; + PltRel = R_386_JUMP_SLOT; + IRelativeRel = R_386_IRELATIVE; + RelativeRel = R_386_RELATIVE; + TlsGotRel = R_386_TLS_TPOFF; + TlsModuleIndexRel = R_386_TLS_DTPMOD32; + TlsOffsetRel = R_386_TLS_DTPOFF32; + GotEntrySize = 4; + GotPltEntrySize = 4; + PltEntrySize = 16; + PltHeaderSize = 16; + TlsGdRelaxSkip = 2; +} + +RelExpr X86TargetInfo::getRelExpr(uint32_t Type, const SymbolBody &S) const { + switch (Type) { + default: + return R_ABS; + case R_386_TLS_GD: + return R_TLSGD; + case R_386_TLS_LDM: + return R_TLSLD; + case R_386_PLT32: + return R_PLT_PC; + case R_386_PC32: + return R_PC; + case R_386_GOTPC: + return R_GOTONLY_PC; + case R_386_TLS_IE: + return R_GOT; + case R_386_GOT32: + case R_386_GOT32X: + case R_386_TLS_GOTIE: + return R_GOT_FROM_END; + case R_386_GOTOFF: + return R_GOTREL; + case R_386_TLS_LE: + return R_TLS; + case R_386_TLS_LE_32: + return R_NEG_TLS; + } +} + +RelExpr X86TargetInfo::adjustRelaxExpr(uint32_t Type, const uint8_t *Data, + RelExpr Expr) const { + switch (Expr) { + default: + return Expr; + case R_RELAX_TLS_GD_TO_IE: + return R_RELAX_TLS_GD_TO_IE_END; + case R_RELAX_TLS_GD_TO_LE: + return R_RELAX_TLS_GD_TO_LE_NEG; + } +} + +void X86TargetInfo::writeGotPltHeader(uint8_t *Buf) const { + write32le(Buf, Out::Dynamic->getVA()); +} + +void X86TargetInfo::writeGotPlt(uint8_t *Buf, const SymbolBody &S) const { + // Entries in .got.plt initially points back to the corresponding + // PLT entries with a fixed offset to skip the first instruction. + write32le(Buf, S.getPltVA() + 6); +} + +uint32_t X86TargetInfo::getDynRel(uint32_t Type) const { + if (Type == R_386_TLS_LE) + return R_386_TLS_TPOFF; + if (Type == R_386_TLS_LE_32) + return R_386_TLS_TPOFF32; + return Type; +} + +bool X86TargetInfo::isTlsGlobalDynamicRel(uint32_t Type) const { + return Type == R_386_TLS_GD; +} + +bool X86TargetInfo::isTlsLocalDynamicRel(uint32_t Type) const { + return Type == R_386_TLS_LDO_32 || Type == R_386_TLS_LDM; +} + +bool X86TargetInfo::isTlsInitialExecRel(uint32_t Type) const { + return Type == R_386_TLS_IE || Type == R_386_TLS_GOTIE; +} + +void X86TargetInfo::writePltHeader(uint8_t *Buf) const { + // Executable files and shared object files have + // separate procedure linkage tables. + if (Config->Pic) { + const uint8_t V[] = { + 0xff, 0xb3, 0x04, 0x00, 0x00, 0x00, // pushl 4(%ebx) + 0xff, 0xa3, 0x08, 0x00, 0x00, 0x00, // jmp *8(%ebx) + 0x90, 0x90, 0x90, 0x90 // nop; nop; nop; nop + }; + memcpy(Buf, V, sizeof(V)); + return; + } + + const uint8_t PltData[] = { + 0xff, 0x35, 0x00, 0x00, 0x00, 0x00, // pushl (GOT+4) + 0xff, 0x25, 0x00, 0x00, 0x00, 0x00, // jmp *(GOT+8) + 0x90, 0x90, 0x90, 0x90 // nop; nop; nop; nop + }; + memcpy(Buf, PltData, sizeof(PltData)); + uint32_t Got = Out::GotPlt->getVA(); + write32le(Buf + 2, Got + 4); + write32le(Buf + 8, Got + 8); +} + +void X86TargetInfo::writePlt(uint8_t *Buf, uint64_t GotEntryAddr, + uint64_t PltEntryAddr, int32_t Index, + unsigned RelOff) const { + const uint8_t Inst[] = { + 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, // jmp *foo_in_GOT|*foo@GOT(%ebx) + 0x68, 0x00, 0x00, 0x00, 0x00, // pushl $reloc_offset + 0xe9, 0x00, 0x00, 0x00, 0x00 // jmp .PLT0@PC + }; + memcpy(Buf, Inst, sizeof(Inst)); + + // jmp *foo@GOT(%ebx) or jmp *foo_in_GOT + Buf[1] = Config->Pic ? 0xa3 : 0x25; + uint32_t Got = Out::GotPlt->getVA(); + write32le(Buf + 2, Config->Shared ? GotEntryAddr - Got : GotEntryAddr); + write32le(Buf + 7, RelOff); + write32le(Buf + 12, -Index * PltEntrySize - PltHeaderSize - 16); +} + +uint64_t X86TargetInfo::getImplicitAddend(const uint8_t *Buf, + uint32_t Type) const { + switch (Type) { + default: + return 0; + case R_386_32: + case R_386_GOT32: + case R_386_GOT32X: + case R_386_GOTOFF: + case R_386_GOTPC: + case R_386_PC32: + case R_386_PLT32: + case R_386_TLS_LE: + return read32le(Buf); + } +} + +void X86TargetInfo::relocateOne(uint8_t *Loc, uint32_t Type, + uint64_t Val) const { + checkInt<32>(Val, Type); + write32le(Loc, Val); +} + +void X86TargetInfo::relaxTlsGdToLe(uint8_t *Loc, uint32_t Type, + uint64_t Val) const { + // Convert + // leal x@tlsgd(, %ebx, 1), + // call __tls_get_addr@plt + // to + // movl %gs:0,%eax + // subl $x@ntpoff,%eax + const uint8_t Inst[] = { + 0x65, 0xa1, 0x00, 0x00, 0x00, 0x00, // movl %gs:0, %eax + 0x81, 0xe8, 0x00, 0x00, 0x00, 0x00 // subl 0(%ebx), %eax + }; + memcpy(Loc - 3, Inst, sizeof(Inst)); + relocateOne(Loc + 5, R_386_32, Val); +} + +void X86TargetInfo::relaxTlsGdToIe(uint8_t *Loc, uint32_t Type, + uint64_t Val) const { + // Convert + // leal x@tlsgd(, %ebx, 1), + // call __tls_get_addr@plt + // to + // movl %gs:0, %eax + // addl x@gotntpoff(%ebx), %eax + const uint8_t Inst[] = { + 0x65, 0xa1, 0x00, 0x00, 0x00, 0x00, // movl %gs:0, %eax + 0x03, 0x83, 0x00, 0x00, 0x00, 0x00 // addl 0(%ebx), %eax + }; + memcpy(Loc - 3, Inst, sizeof(Inst)); + relocateOne(Loc + 5, R_386_32, Val); +} + +// In some conditions, relocations can be optimized to avoid using GOT. +// This function does that for Initial Exec to Local Exec case. +void X86TargetInfo::relaxTlsIeToLe(uint8_t *Loc, uint32_t Type, + uint64_t Val) const { + // Ulrich's document section 6.2 says that @gotntpoff can + // be used with MOVL or ADDL instructions. + // @indntpoff is similar to @gotntpoff, but for use in + // position dependent code. + uint8_t Reg = (Loc[-1] >> 3) & 7; + + if (Type == R_386_TLS_IE) { + if (Loc[-1] == 0xa1) { + // "movl foo@indntpoff,%eax" -> "movl $foo,%eax" + // This case is different from the generic case below because + // this is a 5 byte instruction while below is 6 bytes. + Loc[-1] = 0xb8; + } else if (Loc[-2] == 0x8b) { + // "movl foo@indntpoff,%reg" -> "movl $foo,%reg" + Loc[-2] = 0xc7; + Loc[-1] = 0xc0 | Reg; + } else { + // "addl foo@indntpoff,%reg" -> "addl $foo,%reg" + Loc[-2] = 0x81; + Loc[-1] = 0xc0 | Reg; + } + } else { + assert(Type == R_386_TLS_GOTIE); + if (Loc[-2] == 0x8b) { + // "movl foo@gottpoff(%rip),%reg" -> "movl $foo,%reg" + Loc[-2] = 0xc7; + Loc[-1] = 0xc0 | Reg; + } else { + // "addl foo@gotntpoff(%rip),%reg" -> "leal foo(%reg),%reg" + Loc[-2] = 0x8d; + Loc[-1] = 0x80 | (Reg << 3) | Reg; + } + } + relocateOne(Loc, R_386_TLS_LE, Val); +} + +void X86TargetInfo::relaxTlsLdToLe(uint8_t *Loc, uint32_t Type, + uint64_t Val) const { + if (Type == R_386_TLS_LDO_32) { + relocateOne(Loc, R_386_TLS_LE, Val); + return; + } + + // Convert + // leal foo(%reg),%eax + // call ___tls_get_addr + // to + // movl %gs:0,%eax + // nop + // leal 0(%esi,1),%esi + const uint8_t Inst[] = { + 0x65, 0xa1, 0x00, 0x00, 0x00, 0x00, // movl %gs:0,%eax + 0x90, // nop + 0x8d, 0x74, 0x26, 0x00 // leal 0(%esi,1),%esi + }; + memcpy(Loc - 2, Inst, sizeof(Inst)); +} + +template X86_64TargetInfo::X86_64TargetInfo() { + CopyRel = R_X86_64_COPY; + GotRel = R_X86_64_GLOB_DAT; + PltRel = R_X86_64_JUMP_SLOT; + RelativeRel = R_X86_64_RELATIVE; + IRelativeRel = R_X86_64_IRELATIVE; + TlsGotRel = R_X86_64_TPOFF64; + TlsModuleIndexRel = R_X86_64_DTPMOD64; + TlsOffsetRel = R_X86_64_DTPOFF64; + GotEntrySize = 8; + GotPltEntrySize = 8; + PltEntrySize = 16; + PltHeaderSize = 16; + TlsGdRelaxSkip = 2; +} + +template +RelExpr X86_64TargetInfo::getRelExpr(uint32_t Type, + const SymbolBody &S) const { + switch (Type) { + default: + return R_ABS; + case R_X86_64_TPOFF32: + return R_TLS; + case R_X86_64_TLSLD: + return R_TLSLD_PC; + case R_X86_64_TLSGD: + return R_TLSGD_PC; + case R_X86_64_SIZE32: + case R_X86_64_SIZE64: + return R_SIZE; + case R_X86_64_PLT32: + return R_PLT_PC; + case R_X86_64_PC32: + case R_X86_64_PC64: + return R_PC; + case R_X86_64_GOT32: + return R_GOT_FROM_END; + case R_X86_64_GOTPCREL: + case R_X86_64_GOTPCRELX: + case R_X86_64_REX_GOTPCRELX: + case R_X86_64_GOTTPOFF: + return R_GOT_PC; + } +} + +template +void X86_64TargetInfo::writeGotPltHeader(uint8_t *Buf) const { + // The first entry holds the value of _DYNAMIC. It is not clear why that is + // required, but it is documented in the psabi and the glibc dynamic linker + // seems to use it (note that this is relevant for linking ld.so, not any + // other program). + write64le(Buf, Out::Dynamic->getVA()); +} + +template +void X86_64TargetInfo::writeGotPlt(uint8_t *Buf, + const SymbolBody &S) const { + // See comments in X86TargetInfo::writeGotPlt. + write32le(Buf, S.getPltVA() + 6); +} + +template +void X86_64TargetInfo::writePltHeader(uint8_t *Buf) const { + const uint8_t PltData[] = { + 0xff, 0x35, 0x00, 0x00, 0x00, 0x00, // pushq GOT+8(%rip) + 0xff, 0x25, 0x00, 0x00, 0x00, 0x00, // jmp *GOT+16(%rip) + 0x0f, 0x1f, 0x40, 0x00 // nopl 0x0(rax) + }; + memcpy(Buf, PltData, sizeof(PltData)); + uint64_t Got = Out::GotPlt->getVA(); + uint64_t Plt = Out::Plt->getVA(); + write32le(Buf + 2, Got - Plt + 2); // GOT+8 + write32le(Buf + 8, Got - Plt + 4); // GOT+16 +} + +template +void X86_64TargetInfo::writePlt(uint8_t *Buf, uint64_t GotEntryAddr, + uint64_t PltEntryAddr, int32_t Index, + unsigned RelOff) const { + const uint8_t Inst[] = { + 0xff, 0x25, 0x00, 0x00, 0x00, 0x00, // jmpq *got(%rip) + 0x68, 0x00, 0x00, 0x00, 0x00, // pushq + 0xe9, 0x00, 0x00, 0x00, 0x00 // jmpq plt[0] + }; + memcpy(Buf, Inst, sizeof(Inst)); + + write32le(Buf + 2, GotEntryAddr - PltEntryAddr - 6); + write32le(Buf + 7, Index); + write32le(Buf + 12, -Index * PltEntrySize - PltHeaderSize - 16); +} + +template +uint32_t X86_64TargetInfo::getDynRel(uint32_t Type) const { + if (Type == R_X86_64_PC32 || Type == R_X86_64_32) + errorDynRel(Type); + return Type; +} + +template +bool X86_64TargetInfo::isTlsInitialExecRel(uint32_t Type) const { + return Type == R_X86_64_GOTTPOFF; +} + +template +bool X86_64TargetInfo::isTlsGlobalDynamicRel(uint32_t Type) const { + return Type == R_X86_64_TLSGD; +} + +template +bool X86_64TargetInfo::isTlsLocalDynamicRel(uint32_t Type) const { + return Type == R_X86_64_DTPOFF32 || Type == R_X86_64_DTPOFF64 || + Type == R_X86_64_TLSLD; +} + +template +void X86_64TargetInfo::relaxTlsGdToLe(uint8_t *Loc, uint32_t Type, + uint64_t Val) const { + // Convert + // .byte 0x66 + // leaq x@tlsgd(%rip), %rdi + // .word 0x6666 + // rex64 + // call __tls_get_addr@plt + // to + // mov %fs:0x0,%rax + // lea x@tpoff,%rax + const uint8_t Inst[] = { + 0x64, 0x48, 0x8b, 0x04, 0x25, 0x00, 0x00, 0x00, 0x00, // mov %fs:0x0,%rax + 0x48, 0x8d, 0x80, 0x00, 0x00, 0x00, 0x00 // lea x@tpoff,%rax + }; + memcpy(Loc - 4, Inst, sizeof(Inst)); + // The original code used a pc relative relocation and so we have to + // compensate for the -4 in had in the addend. + relocateOne(Loc + 8, R_X86_64_TPOFF32, Val + 4); +} + +template +void X86_64TargetInfo::relaxTlsGdToIe(uint8_t *Loc, uint32_t Type, + uint64_t Val) const { + // Convert + // .byte 0x66 + // leaq x@tlsgd(%rip), %rdi + // .word 0x6666 + // rex64 + // call __tls_get_addr@plt + // to + // mov %fs:0x0,%rax + // addq x@tpoff,%rax + const uint8_t Inst[] = { + 0x64, 0x48, 0x8b, 0x04, 0x25, 0x00, 0x00, 0x00, 0x00, // mov %fs:0x0,%rax + 0x48, 0x03, 0x05, 0x00, 0x00, 0x00, 0x00 // addq x@tpoff,%rax + }; + memcpy(Loc - 4, Inst, sizeof(Inst)); + // Both code sequences are PC relatives, but since we are moving the constant + // forward by 8 bytes we have to subtract the value by 8. + relocateOne(Loc + 8, R_X86_64_PC32, Val - 8); +} + +// In some conditions, R_X86_64_GOTTPOFF relocation can be optimized to +// R_X86_64_TPOFF32 so that it does not use GOT. +template +void X86_64TargetInfo::relaxTlsIeToLe(uint8_t *Loc, uint32_t Type, + uint64_t Val) const { + uint8_t *Inst = Loc - 3; + uint8_t Reg = Loc[-1] >> 3; + uint8_t *RegSlot = Loc - 1; + + // Note that ADD with RSP or R12 is converted to ADD instead of LEA + // because LEA with these registers needs 4 bytes to encode and thus + // wouldn't fit the space. + + if (memcmp(Inst, "\x48\x03\x25", 3) == 0) { + // "addq foo@gottpoff(%rip),%rsp" -> "addq $foo,%rsp" + memcpy(Inst, "\x48\x81\xc4", 3); + } else if (memcmp(Inst, "\x4c\x03\x25", 3) == 0) { + // "addq foo@gottpoff(%rip),%r12" -> "addq $foo,%r12" + memcpy(Inst, "\x49\x81\xc4", 3); + } else if (memcmp(Inst, "\x4c\x03", 2) == 0) { + // "addq foo@gottpoff(%rip),%r[8-15]" -> "leaq foo(%r[8-15]),%r[8-15]" + memcpy(Inst, "\x4d\x8d", 2); + *RegSlot = 0x80 | (Reg << 3) | Reg; + } else if (memcmp(Inst, "\x48\x03", 2) == 0) { + // "addq foo@gottpoff(%rip),%reg -> "leaq foo(%reg),%reg" + memcpy(Inst, "\x48\x8d", 2); + *RegSlot = 0x80 | (Reg << 3) | Reg; + } else if (memcmp(Inst, "\x4c\x8b", 2) == 0) { + // "movq foo@gottpoff(%rip),%r[8-15]" -> "movq $foo,%r[8-15]" + memcpy(Inst, "\x49\xc7", 2); + *RegSlot = 0xc0 | Reg; + } else if (memcmp(Inst, "\x48\x8b", 2) == 0) { + // "movq foo@gottpoff(%rip),%reg" -> "movq $foo,%reg" + memcpy(Inst, "\x48\xc7", 2); + *RegSlot = 0xc0 | Reg; + } else { + fatal("R_X86_64_GOTTPOFF must be used in MOVQ or ADDQ instructions only"); + } + + // The original code used a PC relative relocation. + // Need to compensate for the -4 it had in the addend. + relocateOne(Loc, R_X86_64_TPOFF32, Val + 4); +} + +template +void X86_64TargetInfo::relaxTlsLdToLe(uint8_t *Loc, uint32_t Type, + uint64_t Val) const { + // Convert + // leaq bar@tlsld(%rip), %rdi + // callq __tls_get_addr@PLT + // leaq bar@dtpoff(%rax), %rcx + // to + // .word 0x6666 + // .byte 0x66 + // mov %fs:0,%rax + // leaq bar@tpoff(%rax), %rcx + if (Type == R_X86_64_DTPOFF64) { + write64le(Loc, Val); + return; + } + if (Type == R_X86_64_DTPOFF32) { + relocateOne(Loc, R_X86_64_TPOFF32, Val); + return; + } + + const uint8_t Inst[] = { + 0x66, 0x66, // .word 0x6666 + 0x66, // .byte 0x66 + 0x64, 0x48, 0x8b, 0x04, 0x25, 0x00, 0x00, 0x00, 0x00 // mov %fs:0,%rax + }; + memcpy(Loc - 3, Inst, sizeof(Inst)); +} + +template +void X86_64TargetInfo::relocateOne(uint8_t *Loc, uint32_t Type, + uint64_t Val) const { + switch (Type) { + case R_X86_64_32: + checkUInt<32>(Val, Type); + write32le(Loc, Val); + break; + case R_X86_64_32S: + case R_X86_64_TPOFF32: + case R_X86_64_GOT32: + case R_X86_64_GOTPCREL: + case R_X86_64_GOTPCRELX: + case R_X86_64_REX_GOTPCRELX: + case R_X86_64_PC32: + case R_X86_64_GOTTPOFF: + case R_X86_64_PLT32: + case R_X86_64_TLSGD: + case R_X86_64_TLSLD: + case R_X86_64_DTPOFF32: + case R_X86_64_SIZE32: + checkInt<32>(Val, Type); + write32le(Loc, Val); + break; + case R_X86_64_64: + case R_X86_64_DTPOFF64: + case R_X86_64_SIZE64: + case R_X86_64_PC64: + write64le(Loc, Val); + break; + default: + fatal("unrecognized reloc " + Twine(Type)); + } +} + +template +RelExpr X86_64TargetInfo::adjustRelaxExpr(uint32_t Type, + const uint8_t *Data, + RelExpr RelExpr) const { + if (Type != R_X86_64_GOTPCRELX && Type != R_X86_64_REX_GOTPCRELX) + return RelExpr; + const uint8_t Op = Data[-2]; + const uint8_t ModRm = Data[-1]; + // FIXME: When PIC is disabled and foo is defined locally in the + // lower 32 bit address space, memory operand in mov can be converted into + // immediate operand. Otherwise, mov must be changed to lea. We support only + // latter relaxation at this moment. + if (Op == 0x8b) + return R_RELAX_GOT_PC; + // Relax call and jmp. + if (Op == 0xff && (ModRm == 0x15 || ModRm == 0x25)) + return R_RELAX_GOT_PC; + + // Relaxation of test, adc, add, and, cmp, or, sbb, sub, xor. + // If PIC then no relaxation is available. + // We also don't relax test/binop instructions without REX byte, + // they are 32bit operations and not common to have. + assert(Type == R_X86_64_REX_GOTPCRELX); + return Config->Pic ? RelExpr : R_RELAX_GOT_PC_NOPIC; +} + +// A subset of relaxations can only be applied for no-PIC. This method +// handles such relaxations. Instructions encoding information was taken from: +// "Intel 64 and IA-32 Architectures Software Developer's Manual V2" +// (http://www.intel.com/content/dam/www/public/us/en/documents/manuals/ +// 64-ia-32-architectures-software-developer-instruction-set-reference-manual-325383.pdf) +template +void X86_64TargetInfo::relaxGotNoPic(uint8_t *Loc, uint64_t Val, + uint8_t Op, uint8_t ModRm) const { + const uint8_t Rex = Loc[-3]; + // Convert "test %reg, foo@GOTPCREL(%rip)" to "test $foo, %reg". + if (Op == 0x85) { + // See "TEST-Logical Compare" (4-428 Vol. 2B), + // TEST r/m64, r64 uses "full" ModR / M byte (no opcode extension). + + // ModR/M byte has form XX YYY ZZZ, where + // YYY is MODRM.reg(register 2), ZZZ is MODRM.rm(register 1). + // XX has different meanings: + // 00: The operand's memory address is in reg1. + // 01: The operand's memory address is reg1 + a byte-sized displacement. + // 10: The operand's memory address is reg1 + a word-sized displacement. + // 11: The operand is reg1 itself. + // If an instruction requires only one operand, the unused reg2 field + // holds extra opcode bits rather than a register code + // 0xC0 == 11 000 000 binary. + // 0x38 == 00 111 000 binary. + // We transfer reg2 to reg1 here as operand. + // See "2.1.3 ModR/M and SIB Bytes" (Vol. 2A 2-3). + Loc[-1] = 0xc0 | (ModRm & 0x38) >> 3; // ModR/M byte. + + // Change opcode from TEST r/m64, r64 to TEST r/m64, imm32 + // See "TEST-Logical Compare" (4-428 Vol. 2B). + Loc[-2] = 0xf7; + + // Move R bit to the B bit in REX byte. + // REX byte is encoded as 0100WRXB, where + // 0100 is 4bit fixed pattern. + // REX.W When 1, a 64-bit operand size is used. Otherwise, when 0, the + // default operand size is used (which is 32-bit for most but not all + // instructions). + // REX.R This 1-bit value is an extension to the MODRM.reg field. + // REX.X This 1-bit value is an extension to the SIB.index field. + // REX.B This 1-bit value is an extension to the MODRM.rm field or the + // SIB.base field. + // See "2.2.1.2 More on REX Prefix Fields " (2-8 Vol. 2A). + Loc[-3] = (Rex & ~0x4) | (Rex & 0x4) >> 2; + relocateOne(Loc, R_X86_64_PC32, Val); + return; + } + + // If we are here then we need to relax the adc, add, and, cmp, or, sbb, sub + // or xor operations. + + // Convert "binop foo@GOTPCREL(%rip), %reg" to "binop $foo, %reg". + // Logic is close to one for test instruction above, but we also + // write opcode extension here, see below for details. + Loc[-1] = 0xc0 | (ModRm & 0x38) >> 3 | (Op & 0x3c); // ModR/M byte. + + // Primary opcode is 0x81, opcode extension is one of: + // 000b = ADD, 001b is OR, 010b is ADC, 011b is SBB, + // 100b is AND, 101b is SUB, 110b is XOR, 111b is CMP. + // This value was wrote to MODRM.reg in a line above. + // See "3.2 INSTRUCTIONS (A-M)" (Vol. 2A 3-15), + // "INSTRUCTION SET REFERENCE, N-Z" (Vol. 2B 4-1) for + // descriptions about each operation. + Loc[-2] = 0x81; + Loc[-3] = (Rex & ~0x4) | (Rex & 0x4) >> 2; + relocateOne(Loc, R_X86_64_PC32, Val); +} + +template +void X86_64TargetInfo::relaxGot(uint8_t *Loc, uint64_t Val) const { + const uint8_t Op = Loc[-2]; + const uint8_t ModRm = Loc[-1]; + + // Convert "mov foo@GOTPCREL(%rip),%reg" to "lea foo(%rip),%reg". + if (Op == 0x8b) { + Loc[-2] = 0x8d; + relocateOne(Loc, R_X86_64_PC32, Val); + return; + } + + if (Op != 0xff) { + // We are relaxing a rip relative to an absolute, so compensate + // for the old -4 addend. + assert(!Config->Pic); + relaxGotNoPic(Loc, Val + 4, Op, ModRm); + return; + } + + // Convert call/jmp instructions. + if (ModRm == 0x15) { + // ABI says we can convert "call *foo@GOTPCREL(%rip)" to "nop; call foo". + // Instead we convert to "addr32 call foo" where addr32 is an instruction + // prefix. That makes result expression to be a single instruction. + Loc[-2] = 0x67; // addr32 prefix + Loc[-1] = 0xe8; // call + relocateOne(Loc, R_X86_64_PC32, Val); + return; + } + + // Convert "jmp *foo@GOTPCREL(%rip)" to "jmp foo; nop". + // jmp doesn't return, so it is fine to use nop here, it is just a stub. + assert(ModRm == 0x25); + Loc[-2] = 0xe9; // jmp + Loc[3] = 0x90; // nop + relocateOne(Loc - 1, R_X86_64_PC32, Val + 1); +} + +// Relocation masks following the #lo(value), #hi(value), #ha(value), +// #higher(value), #highera(value), #highest(value), and #highesta(value) +// macros defined in section 4.5.1. Relocation Types of the PPC-elf64abi +// document. +static uint16_t applyPPCLo(uint64_t V) { return V; } +static uint16_t applyPPCHi(uint64_t V) { return V >> 16; } +static uint16_t applyPPCHa(uint64_t V) { return (V + 0x8000) >> 16; } +static uint16_t applyPPCHigher(uint64_t V) { return V >> 32; } +static uint16_t applyPPCHighera(uint64_t V) { return (V + 0x8000) >> 32; } +static uint16_t applyPPCHighest(uint64_t V) { return V >> 48; } +static uint16_t applyPPCHighesta(uint64_t V) { return (V + 0x8000) >> 48; } + +PPCTargetInfo::PPCTargetInfo() {} + +void PPCTargetInfo::relocateOne(uint8_t *Loc, uint32_t Type, + uint64_t Val) const { + switch (Type) { + case R_PPC_ADDR16_HA: + write16be(Loc, applyPPCHa(Val)); + break; + case R_PPC_ADDR16_LO: + write16be(Loc, applyPPCLo(Val)); + break; + default: + fatal("unrecognized reloc " + Twine(Type)); + } +} + +RelExpr PPCTargetInfo::getRelExpr(uint32_t Type, const SymbolBody &S) const { + return R_ABS; +} + +PPC64TargetInfo::PPC64TargetInfo() { + PltRel = GotRel = R_PPC64_GLOB_DAT; + RelativeRel = R_PPC64_RELATIVE; + GotEntrySize = 8; + GotPltEntrySize = 8; + PltEntrySize = 32; + PltHeaderSize = 0; + + // We need 64K pages (at least under glibc/Linux, the loader won't + // set different permissions on a finer granularity than that). + PageSize = 65536; + + // The PPC64 ELF ABI v1 spec, says: + // + // It is normally desirable to put segments with different characteristics + // in separate 256 Mbyte portions of the address space, to give the + // operating system full paging flexibility in the 64-bit address space. + // + // And because the lowest non-zero 256M boundary is 0x10000000, PPC64 linkers + // use 0x10000000 as the starting address. + DefaultImageBase = 0x10000000; +} + +static uint64_t PPC64TocOffset = 0x8000; + +uint64_t getPPC64TocBase() { + // The TOC consists of sections .got, .toc, .tocbss, .plt in that order. The + // TOC starts where the first of these sections starts. We always create a + // .got when we see a relocation that uses it, so for us the start is always + // the .got. + uint64_t TocVA = Out::Got->getVA(); + + // Per the ppc64-elf-linux ABI, The TOC base is TOC value plus 0x8000 + // thus permitting a full 64 Kbytes segment. Note that the glibc startup + // code (crt1.o) assumes that you can get from the TOC base to the + // start of the .toc section with only a single (signed) 16-bit relocation. + return TocVA + PPC64TocOffset; +} + +RelExpr PPC64TargetInfo::getRelExpr(uint32_t Type, const SymbolBody &S) const { + switch (Type) { + default: + return R_ABS; + case R_PPC64_TOC16: + case R_PPC64_TOC16_DS: + case R_PPC64_TOC16_HA: + case R_PPC64_TOC16_HI: + case R_PPC64_TOC16_LO: + case R_PPC64_TOC16_LO_DS: + return R_GOTREL; + case R_PPC64_TOC: + return R_PPC_TOC; + case R_PPC64_REL24: + return R_PPC_PLT_OPD; + } +} + +void PPC64TargetInfo::writePlt(uint8_t *Buf, uint64_t GotEntryAddr, + uint64_t PltEntryAddr, int32_t Index, + unsigned RelOff) const { + uint64_t Off = GotEntryAddr - getPPC64TocBase(); + + // FIXME: What we should do, in theory, is get the offset of the function + // descriptor in the .opd section, and use that as the offset from %r2 (the + // TOC-base pointer). Instead, we have the GOT-entry offset, and that will + // be a pointer to the function descriptor in the .opd section. Using + // this scheme is simpler, but requires an extra indirection per PLT dispatch. + + write32be(Buf, 0xf8410028); // std %r2, 40(%r1) + write32be(Buf + 4, 0x3d620000 | applyPPCHa(Off)); // addis %r11, %r2, X@ha + write32be(Buf + 8, 0xe98b0000 | applyPPCLo(Off)); // ld %r12, X@l(%r11) + write32be(Buf + 12, 0xe96c0000); // ld %r11,0(%r12) + write32be(Buf + 16, 0x7d6903a6); // mtctr %r11 + write32be(Buf + 20, 0xe84c0008); // ld %r2,8(%r12) + write32be(Buf + 24, 0xe96c0010); // ld %r11,16(%r12) + write32be(Buf + 28, 0x4e800420); // bctr +} + +static std::pair toAddr16Rel(uint32_t Type, uint64_t Val) { + uint64_t V = Val - PPC64TocOffset; + switch (Type) { + case R_PPC64_TOC16: return {R_PPC64_ADDR16, V}; + case R_PPC64_TOC16_DS: return {R_PPC64_ADDR16_DS, V}; + case R_PPC64_TOC16_HA: return {R_PPC64_ADDR16_HA, V}; + case R_PPC64_TOC16_HI: return {R_PPC64_ADDR16_HI, V}; + case R_PPC64_TOC16_LO: return {R_PPC64_ADDR16_LO, V}; + case R_PPC64_TOC16_LO_DS: return {R_PPC64_ADDR16_LO_DS, V}; + default: return {Type, Val}; + } +} + +void PPC64TargetInfo::relocateOne(uint8_t *Loc, uint32_t Type, + uint64_t Val) const { + // For a TOC-relative relocation, proceed in terms of the corresponding + // ADDR16 relocation type. + std::tie(Type, Val) = toAddr16Rel(Type, Val); + + switch (Type) { + case R_PPC64_ADDR14: { + checkAlignment<4>(Val, Type); + // Preserve the AA/LK bits in the branch instruction + uint8_t AALK = Loc[3]; + write16be(Loc + 2, (AALK & 3) | (Val & 0xfffc)); + break; + } + case R_PPC64_ADDR16: + checkInt<16>(Val, Type); + write16be(Loc, Val); + break; + case R_PPC64_ADDR16_DS: + checkInt<16>(Val, Type); + write16be(Loc, (read16be(Loc) & 3) | (Val & ~3)); + break; + case R_PPC64_ADDR16_HA: + case R_PPC64_REL16_HA: + write16be(Loc, applyPPCHa(Val)); + break; + case R_PPC64_ADDR16_HI: + case R_PPC64_REL16_HI: + write16be(Loc, applyPPCHi(Val)); + break; + case R_PPC64_ADDR16_HIGHER: + write16be(Loc, applyPPCHigher(Val)); + break; + case R_PPC64_ADDR16_HIGHERA: + write16be(Loc, applyPPCHighera(Val)); + break; + case R_PPC64_ADDR16_HIGHEST: + write16be(Loc, applyPPCHighest(Val)); + break; + case R_PPC64_ADDR16_HIGHESTA: + write16be(Loc, applyPPCHighesta(Val)); + break; + case R_PPC64_ADDR16_LO: + write16be(Loc, applyPPCLo(Val)); + break; + case R_PPC64_ADDR16_LO_DS: + case R_PPC64_REL16_LO: + write16be(Loc, (read16be(Loc) & 3) | (applyPPCLo(Val) & ~3)); + break; + case R_PPC64_ADDR32: + case R_PPC64_REL32: + checkInt<32>(Val, Type); + write32be(Loc, Val); + break; + case R_PPC64_ADDR64: + case R_PPC64_REL64: + case R_PPC64_TOC: + write64be(Loc, Val); + break; + case R_PPC64_REL24: { + uint32_t Mask = 0x03FFFFFC; + checkInt<24>(Val, Type); + write32be(Loc, (read32be(Loc) & ~Mask) | (Val & Mask)); + break; + } + default: + fatal("unrecognized reloc " + Twine(Type)); + } +} + +AArch64TargetInfo::AArch64TargetInfo() { + CopyRel = R_AARCH64_COPY; + RelativeRel = R_AARCH64_RELATIVE; + IRelativeRel = R_AARCH64_IRELATIVE; + GotRel = R_AARCH64_GLOB_DAT; + PltRel = R_AARCH64_JUMP_SLOT; + TlsDescRel = R_AARCH64_TLSDESC; + TlsGotRel = R_AARCH64_TLS_TPREL64; + GotEntrySize = 8; + GotPltEntrySize = 8; + PltEntrySize = 16; + PltHeaderSize = 32; + + // It doesn't seem to be documented anywhere, but tls on aarch64 uses variant + // 1 of the tls structures and the tcb size is 16. + TcbSize = 16; +} + +RelExpr AArch64TargetInfo::getRelExpr(uint32_t Type, + const SymbolBody &S) const { + switch (Type) { + default: + return R_ABS; + case R_AARCH64_TLSDESC_ADR_PAGE21: + return R_TLSDESC_PAGE; + case R_AARCH64_TLSDESC_LD64_LO12_NC: + case R_AARCH64_TLSDESC_ADD_LO12_NC: + return R_TLSDESC; + case R_AARCH64_TLSDESC_CALL: + return R_HINT; + case R_AARCH64_TLSLE_ADD_TPREL_HI12: + case R_AARCH64_TLSLE_ADD_TPREL_LO12_NC: + return R_TLS; + case R_AARCH64_CALL26: + case R_AARCH64_CONDBR19: + case R_AARCH64_JUMP26: + case R_AARCH64_TSTBR14: + return R_PLT_PC; + case R_AARCH64_PREL16: + case R_AARCH64_PREL32: + case R_AARCH64_PREL64: + case R_AARCH64_ADR_PREL_LO21: + return R_PC; + case R_AARCH64_ADR_PREL_PG_HI21: + return R_PAGE_PC; + case R_AARCH64_LD64_GOT_LO12_NC: + case R_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC: + return R_GOT; + case R_AARCH64_ADR_GOT_PAGE: + case R_AARCH64_TLSIE_ADR_GOTTPREL_PAGE21: + return R_GOT_PAGE_PC; + } +} + +RelExpr AArch64TargetInfo::adjustRelaxExpr(uint32_t Type, const uint8_t *Data, + RelExpr Expr) const { + if (Expr == R_RELAX_TLS_GD_TO_IE) { + if (Type == R_AARCH64_TLSDESC_ADR_PAGE21) + return R_RELAX_TLS_GD_TO_IE_PAGE_PC; + return R_RELAX_TLS_GD_TO_IE_ABS; + } + return Expr; +} + +bool AArch64TargetInfo::usesOnlyLowPageBits(uint32_t Type) const { + switch (Type) { + default: + return false; + case R_AARCH64_ADD_ABS_LO12_NC: + case R_AARCH64_LD64_GOT_LO12_NC: + case R_AARCH64_LDST128_ABS_LO12_NC: + case R_AARCH64_LDST16_ABS_LO12_NC: + case R_AARCH64_LDST32_ABS_LO12_NC: + case R_AARCH64_LDST64_ABS_LO12_NC: + case R_AARCH64_LDST8_ABS_LO12_NC: + case R_AARCH64_TLSDESC_ADD_LO12_NC: + case R_AARCH64_TLSDESC_LD64_LO12_NC: + case R_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC: + return true; + } +} + +bool AArch64TargetInfo::isTlsInitialExecRel(uint32_t Type) const { + return Type == R_AARCH64_TLSIE_ADR_GOTTPREL_PAGE21 || + Type == R_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC; +} + +uint32_t AArch64TargetInfo::getDynRel(uint32_t Type) const { + if (Type == R_AARCH64_ABS32 || Type == R_AARCH64_ABS64) + return Type; + // Keep it going with a dummy value so that we can find more reloc errors. + errorDynRel(Type); + return R_AARCH64_ABS32; +} + +void AArch64TargetInfo::writeGotPlt(uint8_t *Buf, const SymbolBody &) const { + write64le(Buf, Out::Plt->getVA()); +} + +static uint64_t getAArch64Page(uint64_t Expr) { + return Expr & (~static_cast(0xFFF)); +} + +void AArch64TargetInfo::writePltHeader(uint8_t *Buf) const { + const uint8_t PltData[] = { + 0xf0, 0x7b, 0xbf, 0xa9, // stp x16, x30, [sp,#-16]! + 0x10, 0x00, 0x00, 0x90, // adrp x16, Page(&(.plt.got[2])) + 0x11, 0x02, 0x40, 0xf9, // ldr x17, [x16, Offset(&(.plt.got[2]))] + 0x10, 0x02, 0x00, 0x91, // add x16, x16, Offset(&(.plt.got[2])) + 0x20, 0x02, 0x1f, 0xd6, // br x17 + 0x1f, 0x20, 0x03, 0xd5, // nop + 0x1f, 0x20, 0x03, 0xd5, // nop + 0x1f, 0x20, 0x03, 0xd5 // nop + }; + memcpy(Buf, PltData, sizeof(PltData)); + + uint64_t Got = Out::GotPlt->getVA(); + uint64_t Plt = Out::Plt->getVA(); + relocateOne(Buf + 4, R_AARCH64_ADR_PREL_PG_HI21, + getAArch64Page(Got + 16) - getAArch64Page(Plt + 4)); + relocateOne(Buf + 8, R_AARCH64_LDST64_ABS_LO12_NC, Got + 16); + relocateOne(Buf + 12, R_AARCH64_ADD_ABS_LO12_NC, Got + 16); +} + +void AArch64TargetInfo::writePlt(uint8_t *Buf, uint64_t GotEntryAddr, + uint64_t PltEntryAddr, int32_t Index, + unsigned RelOff) const { + const uint8_t Inst[] = { + 0x10, 0x00, 0x00, 0x90, // adrp x16, Page(&(.plt.got[n])) + 0x11, 0x02, 0x40, 0xf9, // ldr x17, [x16, Offset(&(.plt.got[n]))] + 0x10, 0x02, 0x00, 0x91, // add x16, x16, Offset(&(.plt.got[n])) + 0x20, 0x02, 0x1f, 0xd6 // br x17 + }; + memcpy(Buf, Inst, sizeof(Inst)); + + relocateOne(Buf, R_AARCH64_ADR_PREL_PG_HI21, + getAArch64Page(GotEntryAddr) - getAArch64Page(PltEntryAddr)); + relocateOne(Buf + 4, R_AARCH64_LDST64_ABS_LO12_NC, GotEntryAddr); + relocateOne(Buf + 8, R_AARCH64_ADD_ABS_LO12_NC, GotEntryAddr); +} + +static void updateAArch64Addr(uint8_t *L, uint64_t Imm) { + uint32_t ImmLo = (Imm & 0x3) << 29; + uint32_t ImmHi = (Imm & 0x1FFFFC) << 3; + uint64_t Mask = (0x3 << 29) | (0x1FFFFC << 3); + write32le(L, (read32le(L) & ~Mask) | ImmLo | ImmHi); +} + +static inline void updateAArch64Add(uint8_t *L, uint64_t Imm) { + or32le(L, (Imm & 0xFFF) << 10); +} + +void AArch64TargetInfo::relocateOne(uint8_t *Loc, uint32_t Type, + uint64_t Val) const { + switch (Type) { + case R_AARCH64_ABS16: + case R_AARCH64_PREL16: + checkIntUInt<16>(Val, Type); + write16le(Loc, Val); + break; + case R_AARCH64_ABS32: + case R_AARCH64_PREL32: + checkIntUInt<32>(Val, Type); + write32le(Loc, Val); + break; + case R_AARCH64_ABS64: + case R_AARCH64_PREL64: + write64le(Loc, Val); + break; + case R_AARCH64_ADD_ABS_LO12_NC: + // This relocation stores 12 bits and there's no instruction + // to do it. Instead, we do a 32 bits store of the value + // of r_addend bitwise-or'ed Loc. This assumes that the addend + // bits in Loc are zero. + or32le(Loc, (Val & 0xFFF) << 10); + break; + case R_AARCH64_ADR_GOT_PAGE: + case R_AARCH64_ADR_PREL_PG_HI21: + case R_AARCH64_TLSIE_ADR_GOTTPREL_PAGE21: + case R_AARCH64_TLSDESC_ADR_PAGE21: + checkInt<33>(Val, Type); + updateAArch64Addr(Loc, Val >> 12); + break; + case R_AARCH64_ADR_PREL_LO21: + checkInt<21>(Val, Type); + updateAArch64Addr(Loc, Val); + break; + case R_AARCH64_CALL26: + case R_AARCH64_JUMP26: + checkInt<28>(Val, Type); + or32le(Loc, (Val & 0x0FFFFFFC) >> 2); + break; + case R_AARCH64_CONDBR19: + checkInt<21>(Val, Type); + or32le(Loc, (Val & 0x1FFFFC) << 3); + break; + case R_AARCH64_LD64_GOT_LO12_NC: + case R_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC: + case R_AARCH64_TLSDESC_LD64_LO12_NC: + checkAlignment<8>(Val, Type); + or32le(Loc, (Val & 0xFF8) << 7); + break; + case R_AARCH64_LDST128_ABS_LO12_NC: + or32le(Loc, (Val & 0x0FF8) << 6); + break; + case R_AARCH64_LDST16_ABS_LO12_NC: + or32le(Loc, (Val & 0x0FFC) << 9); + break; + case R_AARCH64_LDST8_ABS_LO12_NC: + or32le(Loc, (Val & 0xFFF) << 10); + break; + case R_AARCH64_LDST32_ABS_LO12_NC: + or32le(Loc, (Val & 0xFFC) << 8); + break; + case R_AARCH64_LDST64_ABS_LO12_NC: + or32le(Loc, (Val & 0xFF8) << 7); + break; + case R_AARCH64_TSTBR14: + checkInt<16>(Val, Type); + or32le(Loc, (Val & 0xFFFC) << 3); + break; + case R_AARCH64_TLSLE_ADD_TPREL_HI12: + checkInt<24>(Val, Type); + updateAArch64Add(Loc, Val >> 12); + break; + case R_AARCH64_TLSLE_ADD_TPREL_LO12_NC: + case R_AARCH64_TLSDESC_ADD_LO12_NC: + updateAArch64Add(Loc, Val); + break; + default: + fatal("unrecognized reloc " + Twine(Type)); + } +} + +void AArch64TargetInfo::relaxTlsGdToLe(uint8_t *Loc, uint32_t Type, + uint64_t Val) const { + // TLSDESC Global-Dynamic relocation are in the form: + // adrp x0, :tlsdesc:v [R_AARCH64_TLSDESC_ADR_PAGE21] + // ldr x1, [x0, #:tlsdesc_lo12:v [R_AARCH64_TLSDESC_LD64_LO12_NC] + // add x0, x0, :tlsdesc_los:v [_AARCH64_TLSDESC_ADD_LO12_NC] + // .tlsdesccall [R_AARCH64_TLSDESC_CALL] + // blr x1 + // And it can optimized to: + // movz x0, #0x0, lsl #16 + // movk x0, #0x10 + // nop + // nop + checkUInt<32>(Val, Type); + + switch (Type) { + case R_AARCH64_TLSDESC_ADD_LO12_NC: + case R_AARCH64_TLSDESC_CALL: + write32le(Loc, 0xd503201f); // nop + return; + case R_AARCH64_TLSDESC_ADR_PAGE21: + write32le(Loc, 0xd2a00000 | (((Val >> 16) & 0xffff) << 5)); // movz + return; + case R_AARCH64_TLSDESC_LD64_LO12_NC: + write32le(Loc, 0xf2800000 | ((Val & 0xffff) << 5)); // movk + return; + default: + llvm_unreachable("unsupported relocation for TLS GD to LE relaxation"); + } +} + +void AArch64TargetInfo::relaxTlsGdToIe(uint8_t *Loc, uint32_t Type, + uint64_t Val) const { + // TLSDESC Global-Dynamic relocation are in the form: + // adrp x0, :tlsdesc:v [R_AARCH64_TLSDESC_ADR_PAGE21] + // ldr x1, [x0, #:tlsdesc_lo12:v [R_AARCH64_TLSDESC_LD64_LO12_NC] + // add x0, x0, :tlsdesc_los:v [_AARCH64_TLSDESC_ADD_LO12_NC] + // .tlsdesccall [R_AARCH64_TLSDESC_CALL] + // blr x1 + // And it can optimized to: + // adrp x0, :gottprel:v + // ldr x0, [x0, :gottprel_lo12:v] + // nop + // nop + + switch (Type) { + case R_AARCH64_TLSDESC_ADD_LO12_NC: + case R_AARCH64_TLSDESC_CALL: + write32le(Loc, 0xd503201f); // nop + break; + case R_AARCH64_TLSDESC_ADR_PAGE21: + write32le(Loc, 0x90000000); // adrp + relocateOne(Loc, R_AARCH64_TLSIE_ADR_GOTTPREL_PAGE21, Val); + break; + case R_AARCH64_TLSDESC_LD64_LO12_NC: + write32le(Loc, 0xf9400000); // ldr + relocateOne(Loc, R_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC, Val); + break; + default: + llvm_unreachable("unsupported relocation for TLS GD to LE relaxation"); + } +} + +void AArch64TargetInfo::relaxTlsIeToLe(uint8_t *Loc, uint32_t Type, + uint64_t Val) const { + checkUInt<32>(Val, Type); + + if (Type == R_AARCH64_TLSIE_ADR_GOTTPREL_PAGE21) { + // Generate MOVZ. + uint32_t RegNo = read32le(Loc) & 0x1f; + write32le(Loc, (0xd2a00000 | RegNo) | (((Val >> 16) & 0xffff) << 5)); + return; + } + if (Type == R_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC) { + // Generate MOVK. + uint32_t RegNo = read32le(Loc) & 0x1f; + write32le(Loc, (0xf2800000 | RegNo) | ((Val & 0xffff) << 5)); + return; + } + llvm_unreachable("invalid relocation for TLS IE to LE relaxation"); +} + +AMDGPUTargetInfo::AMDGPUTargetInfo() { + GotRel = R_AMDGPU_ABS64; + GotEntrySize = 8; +} + +void AMDGPUTargetInfo::relocateOne(uint8_t *Loc, uint32_t Type, + uint64_t Val) const { + switch (Type) { + case R_AMDGPU_GOTPCREL: + case R_AMDGPU_REL32: + write32le(Loc, Val); + break; + default: + fatal("unrecognized reloc " + Twine(Type)); + } +} + +RelExpr AMDGPUTargetInfo::getRelExpr(uint32_t Type, const SymbolBody &S) const { + switch (Type) { + case R_AMDGPU_REL32: + return R_PC; + case R_AMDGPU_GOTPCREL: + return R_GOT_PC; + default: + fatal("do not know how to handle relocation " + Twine(Type)); + } +} + +ARMTargetInfo::ARMTargetInfo() { + CopyRel = R_ARM_COPY; + RelativeRel = R_ARM_RELATIVE; + IRelativeRel = R_ARM_IRELATIVE; + GotRel = R_ARM_GLOB_DAT; + PltRel = R_ARM_JUMP_SLOT; + TlsGotRel = R_ARM_TLS_TPOFF32; + TlsModuleIndexRel = R_ARM_TLS_DTPMOD32; + TlsOffsetRel = R_ARM_TLS_DTPOFF32; + GotEntrySize = 4; + GotPltEntrySize = 4; + PltEntrySize = 16; + PltHeaderSize = 20; +} + +RelExpr ARMTargetInfo::getRelExpr(uint32_t Type, const SymbolBody &S) const { + switch (Type) { + default: + return R_ABS; + case R_ARM_THM_JUMP11: + return R_PC; + case R_ARM_CALL: + case R_ARM_JUMP24: + case R_ARM_PC24: + case R_ARM_PLT32: + case R_ARM_THM_JUMP19: + case R_ARM_THM_JUMP24: + case R_ARM_THM_CALL: + return R_PLT_PC; + case R_ARM_GOTOFF32: + // (S + A) - GOT_ORG + return R_GOTREL; + case R_ARM_GOT_BREL: + // GOT(S) + A - GOT_ORG + return R_GOT_OFF; + case R_ARM_GOT_PREL: + // GOT(S) + - GOT_ORG + return R_GOT_PC; + case R_ARM_BASE_PREL: + // B(S) + A - P + // FIXME: currently B(S) assumed to be .got, this may not hold for all + // platforms. + return R_GOTONLY_PC; + case R_ARM_MOVW_PREL_NC: + case R_ARM_MOVT_PREL: + case R_ARM_PREL31: + case R_ARM_REL32: + case R_ARM_THM_MOVW_PREL_NC: + case R_ARM_THM_MOVT_PREL: + return R_PC; + } +} + +uint32_t ARMTargetInfo::getDynRel(uint32_t Type) const { + if (Type == R_ARM_ABS32) + return Type; + // Keep it going with a dummy value so that we can find more reloc errors. + errorDynRel(Type); + return R_ARM_ABS32; +} + +void ARMTargetInfo::writeGotPlt(uint8_t *Buf, const SymbolBody &) const { + write32le(Buf, Out::Plt->getVA()); +} + +void ARMTargetInfo::writePltHeader(uint8_t *Buf) const { + const uint8_t PltData[] = { + 0x04, 0xe0, 0x2d, 0xe5, // str lr, [sp,#-4]! + 0x04, 0xe0, 0x9f, 0xe5, // ldr lr, L2 + 0x0e, 0xe0, 0x8f, 0xe0, // L1: add lr, pc, lr + 0x08, 0xf0, 0xbe, 0xe5, // ldr pc, [lr, #8] + 0x00, 0x00, 0x00, 0x00, // L2: .word &(.got.plt) - L1 - 8 + }; + memcpy(Buf, PltData, sizeof(PltData)); + uint64_t GotPlt = Out::GotPlt->getVA(); + uint64_t L1 = Out::Plt->getVA() + 8; + write32le(Buf + 16, GotPlt - L1 - 8); +} + +void ARMTargetInfo::writePlt(uint8_t *Buf, uint64_t GotEntryAddr, + uint64_t PltEntryAddr, int32_t Index, + unsigned RelOff) const { + // FIXME: Using simple code sequence with simple relocations. + // There is a more optimal sequence but it requires support for the group + // relocations. See ELF for the ARM Architecture Appendix A.3 + const uint8_t PltData[] = { + 0x04, 0xc0, 0x9f, 0xe5, // ldr ip, L2 + 0x0f, 0xc0, 0x8c, 0xe0, // L1: add ip, ip, pc + 0x00, 0xf0, 0x9c, 0xe5, // ldr pc, [ip] + 0x00, 0x00, 0x00, 0x00, // L2: .word Offset(&(.plt.got) - L1 - 8 + }; + memcpy(Buf, PltData, sizeof(PltData)); + uint64_t L1 = PltEntryAddr + 4; + write32le(Buf + 12, GotEntryAddr - L1 - 8); +} + +RelExpr ARMTargetInfo::getThunkExpr(RelExpr Expr, uint32_t RelocType, + const InputFile &File, + const SymbolBody &S) const { + // A state change from ARM to Thumb and vice versa must go through an + // interworking thunk if the relocation type is not R_ARM_CALL or + // R_ARM_THM_CALL. + switch (RelocType) { + case R_ARM_PC24: + case R_ARM_PLT32: + case R_ARM_JUMP24: + // Source is ARM, all PLT entries are ARM so no interworking required. + // Otherwise we need to interwork if Symbol has bit 0 set (Thumb). + if (Expr == R_PC && ((S.getVA() & 1) == 1)) + return R_THUNK_PC; + break; + case R_ARM_THM_JUMP19: + case R_ARM_THM_JUMP24: + // Source is Thumb, all PLT entries are ARM so interworking is required. + // Otherwise we need to interwork if Symbol has bit 0 clear (ARM). + if (Expr == R_PLT_PC) + return R_THUNK_PLT_PC; + if ((S.getVA() & 1) == 0) + return R_THUNK_PC; + break; + } + return Expr; +} + +void ARMTargetInfo::relocateOne(uint8_t *Loc, uint32_t Type, + uint64_t Val) const { + switch (Type) { + case R_ARM_NONE: + break; + case R_ARM_ABS32: + case R_ARM_BASE_PREL: + case R_ARM_GOTOFF32: + case R_ARM_GOT_BREL: + case R_ARM_GOT_PREL: + case R_ARM_REL32: + write32le(Loc, Val); + break; + case R_ARM_PREL31: + checkInt<31>(Val, Type); + write32le(Loc, (read32le(Loc) & 0x80000000) | (Val & ~0x80000000)); + break; + case R_ARM_CALL: + // R_ARM_CALL is used for BL and BLX instructions, depending on the + // value of bit 0 of Val, we must select a BL or BLX instruction + if (Val & 1) { + // If bit 0 of Val is 1 the target is Thumb, we must select a BLX. + // The BLX encoding is 0xfa:H:imm24 where Val = imm24:H:'1' + checkInt<26>(Val, Type); + write32le(Loc, 0xfa000000 | // opcode + ((Val & 2) << 23) | // H + ((Val >> 2) & 0x00ffffff)); // imm24 + break; + } + if ((read32le(Loc) & 0xfe000000) == 0xfa000000) + // BLX (always unconditional) instruction to an ARM Target, select an + // unconditional BL. + write32le(Loc, 0xeb000000 | (read32le(Loc) & 0x00ffffff)); + // fall through as BL encoding is shared with B + case R_ARM_JUMP24: + case R_ARM_PC24: + case R_ARM_PLT32: + checkInt<26>(Val, Type); + write32le(Loc, (read32le(Loc) & ~0x00ffffff) | ((Val >> 2) & 0x00ffffff)); + break; + case R_ARM_THM_JUMP11: + checkInt<12>(Val, Type); + write16le(Loc, (read32le(Loc) & 0xf800) | ((Val >> 1) & 0x07ff)); + break; + case R_ARM_THM_JUMP19: + // Encoding T3: Val = S:J2:J1:imm6:imm11:0 + checkInt<21>(Val, Type); + write16le(Loc, + (read16le(Loc) & 0xfbc0) | // opcode cond + ((Val >> 10) & 0x0400) | // S + ((Val >> 12) & 0x003f)); // imm6 + write16le(Loc + 2, + 0x8000 | // opcode + ((Val >> 8) & 0x0800) | // J2 + ((Val >> 5) & 0x2000) | // J1 + ((Val >> 1) & 0x07ff)); // imm11 + break; + case R_ARM_THM_CALL: + // R_ARM_THM_CALL is used for BL and BLX instructions, depending on the + // value of bit 0 of Val, we must select a BL or BLX instruction + if ((Val & 1) == 0) { + // Ensure BLX destination is 4-byte aligned. As BLX instruction may + // only be two byte aligned. This must be done before overflow check + Val = alignTo(Val, 4); + } + // Bit 12 is 0 for BLX, 1 for BL + write16le(Loc + 2, (read16le(Loc + 2) & ~0x1000) | (Val & 1) << 12); + // Fall through as rest of encoding is the same as B.W + case R_ARM_THM_JUMP24: + // Encoding B T4, BL T1, BLX T2: Val = S:I1:I2:imm10:imm11:0 + // FIXME: Use of I1 and I2 require v6T2ops + checkInt<25>(Val, Type); + write16le(Loc, + 0xf000 | // opcode + ((Val >> 14) & 0x0400) | // S + ((Val >> 12) & 0x03ff)); // imm10 + write16le(Loc + 2, + (read16le(Loc + 2) & 0xd000) | // opcode + (((~(Val >> 10)) ^ (Val >> 11)) & 0x2000) | // J1 + (((~(Val >> 11)) ^ (Val >> 13)) & 0x0800) | // J2 + ((Val >> 1) & 0x07ff)); // imm11 + break; + case R_ARM_MOVW_ABS_NC: + case R_ARM_MOVW_PREL_NC: + write32le(Loc, (read32le(Loc) & ~0x000f0fff) | ((Val & 0xf000) << 4) | + (Val & 0x0fff)); + break; + case R_ARM_MOVT_ABS: + case R_ARM_MOVT_PREL: + checkInt<32>(Val, Type); + write32le(Loc, (read32le(Loc) & ~0x000f0fff) | + (((Val >> 16) & 0xf000) << 4) | ((Val >> 16) & 0xfff)); + break; + case R_ARM_THM_MOVT_ABS: + case R_ARM_THM_MOVT_PREL: + // Encoding T1: A = imm4:i:imm3:imm8 + checkInt<32>(Val, Type); + write16le(Loc, + 0xf2c0 | // opcode + ((Val >> 17) & 0x0400) | // i + ((Val >> 28) & 0x000f)); // imm4 + write16le(Loc + 2, + (read16le(Loc + 2) & 0x8f00) | // opcode + ((Val >> 12) & 0x7000) | // imm3 + ((Val >> 16) & 0x00ff)); // imm8 + break; + case R_ARM_THM_MOVW_ABS_NC: + case R_ARM_THM_MOVW_PREL_NC: + // Encoding T3: A = imm4:i:imm3:imm8 + write16le(Loc, + 0xf240 | // opcode + ((Val >> 1) & 0x0400) | // i + ((Val >> 12) & 0x000f)); // imm4 + write16le(Loc + 2, + (read16le(Loc + 2) & 0x8f00) | // opcode + ((Val << 4) & 0x7000) | // imm3 + (Val & 0x00ff)); // imm8 + break; + default: + fatal("unrecognized reloc " + Twine(Type)); + } +} + +uint64_t ARMTargetInfo::getImplicitAddend(const uint8_t *Buf, + uint32_t Type) const { + switch (Type) { + default: + return 0; + case R_ARM_ABS32: + case R_ARM_BASE_PREL: + case R_ARM_GOTOFF32: + case R_ARM_GOT_BREL: + case R_ARM_GOT_PREL: + case R_ARM_REL32: + return SignExtend64<32>(read32le(Buf)); + case R_ARM_PREL31: + return SignExtend64<31>(read32le(Buf)); + case R_ARM_CALL: + case R_ARM_JUMP24: + case R_ARM_PC24: + case R_ARM_PLT32: + return SignExtend64<26>(read32le(Buf) << 2); + case R_ARM_THM_JUMP11: + return SignExtend64<12>(read16le(Buf) << 1); + case R_ARM_THM_JUMP19: { + // Encoding T3: A = S:J2:J1:imm10:imm6:0 + uint16_t Hi = read16le(Buf); + uint16_t Lo = read16le(Buf + 2); + return SignExtend64<20>(((Hi & 0x0400) << 10) | // S + ((Lo & 0x0800) << 8) | // J2 + ((Lo & 0x2000) << 5) | // J1 + ((Hi & 0x003f) << 12) | // imm6 + ((Lo & 0x07ff) << 1)); // imm11:0 + } + case R_ARM_THM_CALL: + case R_ARM_THM_JUMP24: { + // Encoding B T4, BL T1, BLX T2: A = S:I1:I2:imm10:imm11:0 + // I1 = NOT(J1 EOR S), I2 = NOT(J2 EOR S) + // FIXME: I1 and I2 require v6T2ops + uint16_t Hi = read16le(Buf); + uint16_t Lo = read16le(Buf + 2); + return SignExtend64<24>(((Hi & 0x0400) << 14) | // S + (~((Lo ^ (Hi << 3)) << 10) & 0x00800000) | // I1 + (~((Lo ^ (Hi << 1)) << 11) & 0x00400000) | // I2 + ((Hi & 0x003ff) << 12) | // imm0 + ((Lo & 0x007ff) << 1)); // imm11:0 + } + // ELF for the ARM Architecture 4.6.1.1 the implicit addend for MOVW and + // MOVT is in the range -32768 <= A < 32768 + case R_ARM_MOVW_ABS_NC: + case R_ARM_MOVT_ABS: + case R_ARM_MOVW_PREL_NC: + case R_ARM_MOVT_PREL: { + uint64_t Val = read32le(Buf) & 0x000f0fff; + return SignExtend64<16>(((Val & 0x000f0000) >> 4) | (Val & 0x00fff)); + } + case R_ARM_THM_MOVW_ABS_NC: + case R_ARM_THM_MOVT_ABS: + case R_ARM_THM_MOVW_PREL_NC: + case R_ARM_THM_MOVT_PREL: { + // Encoding T3: A = imm4:i:imm3:imm8 + uint16_t Hi = read16le(Buf); + uint16_t Lo = read16le(Buf + 2); + return SignExtend64<16>(((Hi & 0x000f) << 12) | // imm4 + ((Hi & 0x0400) << 1) | // i + ((Lo & 0x7000) >> 4) | // imm3 + (Lo & 0x00ff)); // imm8 + } + } +} + +template MipsTargetInfo::MipsTargetInfo() { + GotPltHeaderEntriesNum = 2; + PageSize = 65536; + GotEntrySize = sizeof(typename ELFT::uint); + GotPltEntrySize = sizeof(typename ELFT::uint); + PltEntrySize = 16; + PltHeaderSize = 32; + CopyRel = R_MIPS_COPY; + PltRel = R_MIPS_JUMP_SLOT; + if (ELFT::Is64Bits) { + RelativeRel = (R_MIPS_64 << 8) | R_MIPS_REL32; + TlsGotRel = R_MIPS_TLS_TPREL64; + TlsModuleIndexRel = R_MIPS_TLS_DTPMOD64; + TlsOffsetRel = R_MIPS_TLS_DTPREL64; + } else { + RelativeRel = R_MIPS_REL32; + TlsGotRel = R_MIPS_TLS_TPREL32; + TlsModuleIndexRel = R_MIPS_TLS_DTPMOD32; + TlsOffsetRel = R_MIPS_TLS_DTPREL32; + } +} + +template +RelExpr MipsTargetInfo::getRelExpr(uint32_t Type, + const SymbolBody &S) const { + if (ELFT::Is64Bits) + // See comment in the calculateMips64RelChain. + Type &= 0xff; + switch (Type) { + default: + return R_ABS; + case R_MIPS_JALR: + return R_HINT; + case R_MIPS_GPREL16: + case R_MIPS_GPREL32: + return R_GOTREL; + case R_MIPS_26: + return R_PLT; + case R_MIPS_HI16: + case R_MIPS_LO16: + case R_MIPS_GOT_OFST: + // MIPS _gp_disp designates offset between start of function and 'gp' + // pointer into GOT. __gnu_local_gp is equal to the current value of + // the 'gp'. Therefore any relocations against them do not require + // dynamic relocation. + if (&S == ElfSym::MipsGpDisp) + return R_PC; + return R_ABS; + case R_MIPS_PC32: + case R_MIPS_PC16: + case R_MIPS_PC19_S2: + case R_MIPS_PC21_S2: + case R_MIPS_PC26_S2: + case R_MIPS_PCHI16: + case R_MIPS_PCLO16: + return R_PC; + case R_MIPS_GOT16: + if (S.isLocal()) + return R_MIPS_GOT_LOCAL_PAGE; + // fallthrough + case R_MIPS_CALL16: + case R_MIPS_GOT_DISP: + case R_MIPS_TLS_GOTTPREL: + return R_MIPS_GOT_OFF; + case R_MIPS_GOT_PAGE: + return R_MIPS_GOT_LOCAL_PAGE; + case R_MIPS_TLS_GD: + return R_MIPS_TLSGD; + case R_MIPS_TLS_LDM: + return R_MIPS_TLSLD; + } +} + +template +uint32_t MipsTargetInfo::getDynRel(uint32_t Type) const { + if (Type == R_MIPS_32 || Type == R_MIPS_64) + return RelativeRel; + // Keep it going with a dummy value so that we can find more reloc errors. + errorDynRel(Type); + return R_MIPS_32; +} + +template +bool MipsTargetInfo::isTlsLocalDynamicRel(uint32_t Type) const { + return Type == R_MIPS_TLS_LDM; +} + +template +bool MipsTargetInfo::isTlsGlobalDynamicRel(uint32_t Type) const { + return Type == R_MIPS_TLS_GD; +} + +template +void MipsTargetInfo::writeGotPlt(uint8_t *Buf, const SymbolBody &) const { + write32(Buf, Out::Plt->getVA()); +} + +static uint16_t mipsHigh(uint64_t V) { return (V + 0x8000) >> 16; } + +template +static int64_t getPcRelocAddend(const uint8_t *Loc) { + uint32_t Instr = read32(Loc); + uint32_t Mask = 0xffffffff >> (32 - BSIZE); + return SignExtend64((Instr & Mask) << SHIFT); +} + +template +static void applyMipsPcReloc(uint8_t *Loc, uint32_t Type, uint64_t V) { + uint32_t Mask = 0xffffffff >> (32 - BSIZE); + uint32_t Instr = read32(Loc); + if (SHIFT > 0) + checkAlignment<(1 << SHIFT)>(V, Type); + checkInt(V, Type); + write32(Loc, (Instr & ~Mask) | ((V >> SHIFT) & Mask)); +} + +template +static void writeMipsHi16(uint8_t *Loc, uint64_t V) { + uint32_t Instr = read32(Loc); + write32(Loc, (Instr & 0xffff0000) | mipsHigh(V)); +} + +template +static void writeMipsLo16(uint8_t *Loc, uint64_t V) { + uint32_t Instr = read32(Loc); + write32(Loc, (Instr & 0xffff0000) | (V & 0xffff)); +} + +template +void MipsTargetInfo::writePltHeader(uint8_t *Buf) const { + const endianness E = ELFT::TargetEndianness; + write32(Buf, 0x3c1c0000); // lui $28, %hi(&GOTPLT[0]) + write32(Buf + 4, 0x8f990000); // lw $25, %lo(&GOTPLT[0])($28) + write32(Buf + 8, 0x279c0000); // addiu $28, $28, %lo(&GOTPLT[0]) + write32(Buf + 12, 0x031cc023); // subu $24, $24, $28 + write32(Buf + 16, 0x03e07825); // move $15, $31 + write32(Buf + 20, 0x0018c082); // srl $24, $24, 2 + write32(Buf + 24, 0x0320f809); // jalr $25 + write32(Buf + 28, 0x2718fffe); // subu $24, $24, 2 + uint64_t Got = Out::GotPlt->getVA(); + writeMipsHi16(Buf, Got); + writeMipsLo16(Buf + 4, Got); + writeMipsLo16(Buf + 8, Got); +} + +template +void MipsTargetInfo::writePlt(uint8_t *Buf, uint64_t GotEntryAddr, + uint64_t PltEntryAddr, int32_t Index, + unsigned RelOff) const { + const endianness E = ELFT::TargetEndianness; + write32(Buf, 0x3c0f0000); // lui $15, %hi(.got.plt entry) + write32(Buf + 4, 0x8df90000); // l[wd] $25, %lo(.got.plt entry)($15) + write32(Buf + 8, 0x03200008); // jr $25 + write32(Buf + 12, 0x25f80000); // addiu $24, $15, %lo(.got.plt entry) + writeMipsHi16(Buf, GotEntryAddr); + writeMipsLo16(Buf + 4, GotEntryAddr); + writeMipsLo16(Buf + 12, GotEntryAddr); +} + +template +RelExpr MipsTargetInfo::getThunkExpr(RelExpr Expr, uint32_t Type, + const InputFile &File, + const SymbolBody &S) const { + // Any MIPS PIC code function is invoked with its address in register $t9. + // So if we have a branch instruction from non-PIC code to the PIC one + // we cannot make the jump directly and need to create a small stubs + // to save the target function address. + // See page 3-38 ftp://www.linux-mips.org/pub/linux/mips/doc/ABI/mipsabi.pdf + if (Type != R_MIPS_26) + return Expr; + auto *F = dyn_cast>(&File); + if (!F) + return Expr; + // If current file has PIC code, LA25 stub is not required. + if (F->getObj().getHeader()->e_flags & EF_MIPS_PIC) + return Expr; + auto *D = dyn_cast>(&S); + if (!D || !D->Section) + return Expr; + // LA25 is required if target file has PIC code + // or target symbol is a PIC symbol. + const ELFFile &DefFile = D->Section->getFile()->getObj(); + bool PicFile = DefFile.getHeader()->e_flags & EF_MIPS_PIC; + bool PicSym = (D->StOther & STO_MIPS_MIPS16) == STO_MIPS_PIC; + return (PicFile || PicSym) ? R_THUNK_ABS : Expr; +} + +template +uint64_t MipsTargetInfo::getImplicitAddend(const uint8_t *Buf, + uint32_t Type) const { + const endianness E = ELFT::TargetEndianness; + switch (Type) { + default: + return 0; + case R_MIPS_32: + case R_MIPS_GPREL32: + return read32(Buf); + case R_MIPS_26: + // FIXME (simon): If the relocation target symbol is not a PLT entry + // we should use another expression for calculation: + // ((A << 2) | (P & 0xf0000000)) >> 2 + return SignExtend64<28>(read32(Buf) << 2); + case R_MIPS_GPREL16: + case R_MIPS_LO16: + case R_MIPS_PCLO16: + case R_MIPS_TLS_DTPREL_HI16: + case R_MIPS_TLS_DTPREL_LO16: + case R_MIPS_TLS_TPREL_HI16: + case R_MIPS_TLS_TPREL_LO16: + return SignExtend64<16>(read32(Buf)); + case R_MIPS_PC16: + return getPcRelocAddend(Buf); + case R_MIPS_PC19_S2: + return getPcRelocAddend(Buf); + case R_MIPS_PC21_S2: + return getPcRelocAddend(Buf); + case R_MIPS_PC26_S2: + return getPcRelocAddend(Buf); + case R_MIPS_PC32: + return getPcRelocAddend(Buf); + } +} + +static std::pair calculateMips64RelChain(uint32_t Type, + uint64_t Val) { + // MIPS N64 ABI packs multiple relocations into the single relocation + // record. In general, all up to three relocations can have arbitrary + // types. In fact, Clang and GCC uses only a few combinations. For now, + // we support two of them. That is allow to pass at least all LLVM + // test suite cases. + // / R_MIPS_SUB / R_MIPS_HI16 | R_MIPS_LO16 + // / R_MIPS_64 / R_MIPS_NONE + // The first relocation is a 'real' relocation which is calculated + // using the corresponding symbol's value. The second and the third + // relocations used to modify result of the first one: extend it to + // 64-bit, extract high or low part etc. For details, see part 2.9 Relocation + // at the https://dmz-portal.mips.com/mw/images/8/82/007-4658-001.pdf + uint32_t Type2 = (Type >> 8) & 0xff; + uint32_t Type3 = (Type >> 16) & 0xff; + if (Type2 == R_MIPS_NONE && Type3 == R_MIPS_NONE) + return std::make_pair(Type, Val); + if (Type2 == R_MIPS_64 && Type3 == R_MIPS_NONE) + return std::make_pair(Type2, Val); + if (Type2 == R_MIPS_SUB && (Type3 == R_MIPS_HI16 || Type3 == R_MIPS_LO16)) + return std::make_pair(Type3, -Val); + error("unsupported relocations combination " + Twine(Type)); + return std::make_pair(Type & 0xff, Val); +} + +template +void MipsTargetInfo::relocateOne(uint8_t *Loc, uint32_t Type, + uint64_t Val) const { + const endianness E = ELFT::TargetEndianness; + // Thread pointer and DRP offsets from the start of TLS data area. + // https://www.linux-mips.org/wiki/NPTL + if (Type == R_MIPS_TLS_DTPREL_HI16 || Type == R_MIPS_TLS_DTPREL_LO16) + Val -= 0x8000; + else if (Type == R_MIPS_TLS_TPREL_HI16 || Type == R_MIPS_TLS_TPREL_LO16) + Val -= 0x7000; + if (ELFT::Is64Bits) + std::tie(Type, Val) = calculateMips64RelChain(Type, Val); + switch (Type) { + case R_MIPS_32: + case R_MIPS_GPREL32: + write32(Loc, Val); + break; + case R_MIPS_64: + write64(Loc, Val); + break; + case R_MIPS_26: + write32(Loc, (read32(Loc) & ~0x3ffffff) | (Val >> 2)); + break; + case R_MIPS_GOT_DISP: + case R_MIPS_GOT_PAGE: + case R_MIPS_GOT16: + case R_MIPS_GPREL16: + case R_MIPS_TLS_GD: + case R_MIPS_TLS_LDM: + checkInt<16>(Val, Type); + // fallthrough + case R_MIPS_CALL16: + case R_MIPS_GOT_OFST: + case R_MIPS_LO16: + case R_MIPS_PCLO16: + case R_MIPS_TLS_DTPREL_LO16: + case R_MIPS_TLS_GOTTPREL: + case R_MIPS_TLS_TPREL_LO16: + writeMipsLo16(Loc, Val); + break; + case R_MIPS_HI16: + case R_MIPS_PCHI16: + case R_MIPS_TLS_DTPREL_HI16: + case R_MIPS_TLS_TPREL_HI16: + writeMipsHi16(Loc, Val); + break; + case R_MIPS_JALR: + // Ignore this optimization relocation for now + break; + case R_MIPS_PC16: + applyMipsPcReloc(Loc, Type, Val); + break; + case R_MIPS_PC19_S2: + applyMipsPcReloc(Loc, Type, Val); + break; + case R_MIPS_PC21_S2: + applyMipsPcReloc(Loc, Type, Val); + break; + case R_MIPS_PC26_S2: + applyMipsPcReloc(Loc, Type, Val); + break; + case R_MIPS_PC32: + applyMipsPcReloc(Loc, Type, Val); + break; + default: + fatal("unrecognized reloc " + Twine(Type)); + } +} + +template +bool MipsTargetInfo::usesOnlyLowPageBits(uint32_t Type) const { + return Type == R_MIPS_LO16 || Type == R_MIPS_GOT_OFST; +} +} +} Property changes on: vendor/lld/lld-release_390-r280324/ELF/Target.cpp ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +FreeBSD=%H \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: vendor/lld/lld-release_390-r280324/ELF/CMakeLists.txt =================================================================== --- vendor/lld/lld-release_390-r280324/ELF/CMakeLists.txt (nonexistent) +++ vendor/lld/lld-release_390-r280324/ELF/CMakeLists.txt (revision 305296) @@ -0,0 +1,50 @@ +set(LLVM_TARGET_DEFINITIONS Options.td) +tablegen(LLVM Options.inc -gen-opt-parser-defs) +add_public_tablegen_target(ELFOptionsTableGen) + +add_lld_library(lldELF + Driver.cpp + DriverUtils.cpp + EhFrame.cpp + Error.cpp + ICF.cpp + InputFiles.cpp + InputSection.cpp + LTO.cpp + LinkerScript.cpp + MarkLive.cpp + OutputSections.cpp + Relocations.cpp + ScriptParser.cpp + Strings.cpp + SymbolListFile.cpp + SymbolTable.cpp + Symbols.cpp + Target.cpp + Thunks.cpp + Writer.cpp + + LINK_COMPONENTS + ${LLVM_TARGETS_TO_BUILD} + Analysis + BitReader + BitWriter + Codegen + Core + IPO + Linker + LTO + Object + Option + Passes + MC + Support + Target + TransformUtils + + LINK_LIBS + lldConfig + ${PTHREAD_LIB} + ) + +add_dependencies(lldELF intrinsics_gen ELFOptionsTableGen) Property changes on: vendor/lld/lld-release_390-r280324/ELF/CMakeLists.txt ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +FreeBSD=%H \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: vendor/lld/lld-release_390-r280324/ELF/Config.h =================================================================== --- vendor/lld/lld-release_390-r280324/ELF/Config.h (nonexistent) +++ vendor/lld/lld-release_390-r280324/ELF/Config.h (revision 305296) @@ -0,0 +1,134 @@ +//===- Config.h -------------------------------------------------*- C++ -*-===// +// +// The LLVM Linker +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +#ifndef LLD_ELF_CONFIG_H +#define LLD_ELF_CONFIG_H + +#include "llvm/ADT/MapVector.h" +#include "llvm/ADT/StringRef.h" +#include "llvm/Support/ELF.h" + +#include + +namespace lld { +namespace elf { + +class InputFile; +struct Symbol; + +enum ELFKind { + ELFNoneKind, + ELF32LEKind, + ELF32BEKind, + ELF64LEKind, + ELF64BEKind +}; + +enum class BuildIdKind { None, Fnv1, Md5, Sha1, Hexstring }; + +enum class UnresolvedPolicy { NoUndef, Error, Warn, Ignore }; + +struct SymbolVersion { + llvm::StringRef Name; + bool IsExternCpp; +}; + +// This struct contains symbols version definition that +// can be found in version script if it is used for link. +struct VersionDefinition { + VersionDefinition(llvm::StringRef Name, size_t Id) : Name(Name), Id(Id) {} + llvm::StringRef Name; + size_t Id; + std::vector Globals; + size_t NameOff; // Offset in string table. +}; + +// This struct contains the global configuration for the linker. +// Most fields are direct mapping from the command line options +// and such fields have the same name as the corresponding options. +// Most fields are initialized by the driver. +struct Configuration { + Symbol *EntrySym = nullptr; + InputFile *FirstElf = nullptr; + llvm::StringRef DynamicLinker; + llvm::StringRef Entry; + llvm::StringRef Emulation; + llvm::StringRef Fini; + llvm::StringRef Init; + llvm::StringRef LtoAAPipeline; + llvm::StringRef LtoNewPmPasses; + llvm::StringRef OutputFile; + llvm::StringRef SoName; + llvm::StringRef Sysroot; + std::string RPath; + std::vector VersionDefinitions; + std::vector DynamicList; + std::vector SearchPaths; + std::vector Undefined; + std::vector VersionScriptGlobals; + std::vector BuildIdVector; + bool AllowMultipleDefinition; + bool AsNeeded = false; + bool Bsymbolic; + bool BsymbolicFunctions; + bool Demangle = true; + bool DisableVerify; + bool DiscardAll; + bool DiscardLocals; + bool DiscardNone; + bool EhFrameHdr; + bool EnableNewDtags; + bool ExportDynamic; + bool FatalWarnings; + bool GcSections; + bool GnuHash = false; + bool ICF; + bool Mips64EL = false; + bool NoGnuUnique; + bool NoUndefinedVersion; + bool Pic; + bool Pie; + bool PrintGcSections; + bool Rela; + bool Relocatable; + bool SaveTemps; + bool Shared; + bool Static = false; + bool StripAll; + bool StripDebug; + bool SysvHash = true; + bool Threads; + bool Trace; + bool Verbose; + bool WarnCommon; + bool ZCombreloc; + bool ZExecStack; + bool ZNodelete; + bool ZNow; + bool ZOrigin; + bool ZRelro; + UnresolvedPolicy UnresolvedSymbols; + BuildIdKind BuildId = BuildIdKind::None; + ELFKind EKind = ELFNoneKind; + uint16_t DefaultSymbolVersion = llvm::ELF::VER_NDX_GLOBAL; + uint16_t EMachine = llvm::ELF::EM_NONE; + uint64_t EntryAddr = -1; + uint64_t ImageBase; + unsigned LtoJobs; + unsigned LtoO; + unsigned Optimize; +}; + +// The only instance of Configuration struct. +extern Configuration *Config; + +} // namespace elf +} // namespace lld + +#endif Property changes on: vendor/lld/lld-release_390-r280324/ELF/Config.h ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +FreeBSD=%H \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: vendor/lld/lld-release_390-r280324/ELF/Driver.cpp =================================================================== --- vendor/lld/lld-release_390-r280324/ELF/Driver.cpp (nonexistent) +++ vendor/lld/lld-release_390-r280324/ELF/Driver.cpp (revision 305296) @@ -0,0 +1,588 @@ +//===- Driver.cpp ---------------------------------------------------------===// +// +// The LLVM Linker +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +#include "Driver.h" +#include "Config.h" +#include "Error.h" +#include "ICF.h" +#include "InputFiles.h" +#include "InputSection.h" +#include "LinkerScript.h" +#include "Strings.h" +#include "SymbolListFile.h" +#include "SymbolTable.h" +#include "Target.h" +#include "Writer.h" +#include "lld/Driver/Driver.h" +#include "llvm/ADT/StringExtras.h" +#include "llvm/ADT/StringSwitch.h" +#include "llvm/Support/TargetSelect.h" +#include "llvm/Support/raw_ostream.h" +#include +#include + +using namespace llvm; +using namespace llvm::ELF; +using namespace llvm::object; +using namespace llvm::sys; + +using namespace lld; +using namespace lld::elf; + +Configuration *elf::Config; +LinkerDriver *elf::Driver; + +bool elf::link(ArrayRef Args, raw_ostream &Error) { + HasError = false; + ErrorOS = &Error; + + Configuration C; + LinkerDriver D; + ScriptConfiguration SC; + Config = &C; + Driver = &D; + ScriptConfig = &SC; + + Driver->main(Args); + return !HasError; +} + +// Parses a linker -m option. +static std::pair parseEmulation(StringRef S) { + if (S.endswith("_fbsd")) + S = S.drop_back(5); + + std::pair Ret = + StringSwitch>(S) + .Case("aarch64linux", {ELF64LEKind, EM_AARCH64}) + .Case("armelf_linux_eabi", {ELF32LEKind, EM_ARM}) + .Case("elf32_x86_64", {ELF32LEKind, EM_X86_64}) + .Case("elf32btsmip", {ELF32BEKind, EM_MIPS}) + .Case("elf32ltsmip", {ELF32LEKind, EM_MIPS}) + .Case("elf32ppc", {ELF32BEKind, EM_PPC}) + .Case("elf64btsmip", {ELF64BEKind, EM_MIPS}) + .Case("elf64ltsmip", {ELF64LEKind, EM_MIPS}) + .Case("elf64ppc", {ELF64BEKind, EM_PPC64}) + .Case("elf_i386", {ELF32LEKind, EM_386}) + .Case("elf_x86_64", {ELF64LEKind, EM_X86_64}) + .Default({ELFNoneKind, EM_NONE}); + + if (Ret.first == ELFNoneKind) { + if (S == "i386pe" || S == "i386pep" || S == "thumb2pe") + error("Windows targets are not supported on the ELF frontend: " + S); + else + error("unknown emulation: " + S); + } + return Ret; +} + +// Returns slices of MB by parsing MB as an archive file. +// Each slice consists of a member file in the archive. +std::vector +LinkerDriver::getArchiveMembers(MemoryBufferRef MB) { + std::unique_ptr File = + check(Archive::create(MB), "failed to parse archive"); + + std::vector V; + Error Err; + for (const ErrorOr &COrErr : File->children(Err)) { + Archive::Child C = check(COrErr, "could not get the child of the archive " + + File->getFileName()); + MemoryBufferRef MBRef = + check(C.getMemoryBufferRef(), + "could not get the buffer for a child of the archive " + + File->getFileName()); + V.push_back(MBRef); + } + if (Err) + Error(Err); + + // Take ownership of memory buffers created for members of thin archives. + for (std::unique_ptr &MB : File->takeThinBuffers()) + OwningMBs.push_back(std::move(MB)); + + return V; +} + +// Opens and parses a file. Path has to be resolved already. +// Newly created memory buffers are owned by this driver. +void LinkerDriver::addFile(StringRef Path) { + using namespace sys::fs; + if (Config->Verbose) + outs() << Path << "\n"; + + Optional Buffer = readFile(Path); + if (!Buffer.hasValue()) + return; + MemoryBufferRef MBRef = *Buffer; + + switch (identify_magic(MBRef.getBuffer())) { + case file_magic::unknown: + readLinkerScript(MBRef); + return; + case file_magic::archive: + if (WholeArchive) { + for (MemoryBufferRef MB : getArchiveMembers(MBRef)) + Files.push_back(createObjectFile(MB, Path)); + return; + } + Files.push_back(make_unique(MBRef)); + return; + case file_magic::elf_shared_object: + if (Config->Relocatable) { + error("attempted static link of dynamic object " + Path); + return; + } + Files.push_back(createSharedFile(MBRef)); + return; + default: + if (InLib) + Files.push_back(make_unique(MBRef)); + else + Files.push_back(createObjectFile(MBRef)); + } +} + +Optional LinkerDriver::readFile(StringRef Path) { + auto MBOrErr = MemoryBuffer::getFile(Path); + if (auto EC = MBOrErr.getError()) { + error(EC, "cannot open " + Path); + return None; + } + std::unique_ptr &MB = *MBOrErr; + MemoryBufferRef MBRef = MB->getMemBufferRef(); + OwningMBs.push_back(std::move(MB)); // take MB ownership + + if (Cpio) + Cpio->append(relativeToRoot(Path), MBRef.getBuffer()); + + return MBRef; +} + +// Add a given library by searching it from input search paths. +void LinkerDriver::addLibrary(StringRef Name) { + std::string Path = searchLibrary(Name); + if (Path.empty()) + error("unable to find library -l" + Name); + else + addFile(Path); +} + +// This function is called on startup. We need this for LTO since +// LTO calls LLVM functions to compile bitcode files to native code. +// Technically this can be delayed until we read bitcode files, but +// we don't bother to do lazily because the initialization is fast. +static void initLLVM(opt::InputArgList &Args) { + InitializeAllTargets(); + InitializeAllTargetMCs(); + InitializeAllAsmPrinters(); + InitializeAllAsmParsers(); + + // This is a flag to discard all but GlobalValue names. + // We want to enable it by default because it saves memory. + // Disable it only when a developer option (-save-temps) is given. + Driver->Context.setDiscardValueNames(!Config->SaveTemps); + Driver->Context.enableDebugTypeODRUniquing(); + + // Parse and evaluate -mllvm options. + std::vector V; + V.push_back("lld (LLVM option parsing)"); + for (auto *Arg : Args.filtered(OPT_mllvm)) + V.push_back(Arg->getValue()); + cl::ParseCommandLineOptions(V.size(), V.data()); +} + +// Some command line options or some combinations of them are not allowed. +// This function checks for such errors. +static void checkOptions(opt::InputArgList &Args) { + // The MIPS ABI as of 2016 does not support the GNU-style symbol lookup + // table which is a relatively new feature. + if (Config->EMachine == EM_MIPS && Config->GnuHash) + error("the .gnu.hash section is not compatible with the MIPS target."); + + if (Config->EMachine == EM_AMDGPU && !Config->Entry.empty()) + error("-e option is not valid for AMDGPU."); + + if (Config->Pie && Config->Shared) + error("-shared and -pie may not be used together"); + + if (Config->Relocatable) { + if (Config->Shared) + error("-r and -shared may not be used together"); + if (Config->GcSections) + error("-r and --gc-sections may not be used together"); + if (Config->ICF) + error("-r and --icf may not be used together"); + if (Config->Pie) + error("-r and -pie may not be used together"); + } +} + +static StringRef +getString(opt::InputArgList &Args, unsigned Key, StringRef Default = "") { + if (auto *Arg = Args.getLastArg(Key)) + return Arg->getValue(); + return Default; +} + +static int getInteger(opt::InputArgList &Args, unsigned Key, int Default) { + int V = Default; + if (auto *Arg = Args.getLastArg(Key)) { + StringRef S = Arg->getValue(); + if (S.getAsInteger(10, V)) + error(Arg->getSpelling() + ": number expected, but got " + S); + } + return V; +} + +static const char *getReproduceOption(opt::InputArgList &Args) { + if (auto *Arg = Args.getLastArg(OPT_reproduce)) + return Arg->getValue(); + return getenv("LLD_REPRODUCE"); +} + +static bool hasZOption(opt::InputArgList &Args, StringRef Key) { + for (auto *Arg : Args.filtered(OPT_z)) + if (Key == Arg->getValue()) + return true; + return false; +} + +void LinkerDriver::main(ArrayRef ArgsArr) { + ELFOptTable Parser; + opt::InputArgList Args = Parser.parse(ArgsArr.slice(1)); + if (Args.hasArg(OPT_help)) { + printHelp(ArgsArr[0]); + return; + } + if (Args.hasArg(OPT_version)) { + outs() << getVersionString(); + return; + } + + if (const char *Path = getReproduceOption(Args)) { + // Note that --reproduce is a debug option so you can ignore it + // if you are trying to understand the whole picture of the code. + Cpio.reset(CpioFile::create(Path)); + if (Cpio) { + Cpio->append("response.txt", createResponseFile(Args)); + Cpio->append("version.txt", getVersionString()); + } + } + + readConfigs(Args); + initLLVM(Args); + createFiles(Args); + checkOptions(Args); + if (HasError) + return; + + switch (Config->EKind) { + case ELF32LEKind: + link(Args); + return; + case ELF32BEKind: + link(Args); + return; + case ELF64LEKind: + link(Args); + return; + case ELF64BEKind: + link(Args); + return; + default: + error("-m or at least a .o file required"); + } +} + +static UnresolvedPolicy getUnresolvedSymbolOption(opt::InputArgList &Args) { + if (Args.hasArg(OPT_noinhibit_exec)) + return UnresolvedPolicy::Warn; + if (Args.hasArg(OPT_no_undefined) || hasZOption(Args, "defs")) + return UnresolvedPolicy::NoUndef; + if (Config->Relocatable) + return UnresolvedPolicy::Ignore; + + if (auto *Arg = Args.getLastArg(OPT_unresolved_symbols)) { + StringRef S = Arg->getValue(); + if (S == "ignore-all" || S == "ignore-in-object-files") + return UnresolvedPolicy::Ignore; + if (S == "ignore-in-shared-libs" || S == "report-all") + return UnresolvedPolicy::Error; + error("unknown --unresolved-symbols value: " + S); + } + return UnresolvedPolicy::Error; +} + +// Initializes Config members by the command line options. +void LinkerDriver::readConfigs(opt::InputArgList &Args) { + for (auto *Arg : Args.filtered(OPT_L)) + Config->SearchPaths.push_back(Arg->getValue()); + + std::vector RPaths; + for (auto *Arg : Args.filtered(OPT_rpath)) + RPaths.push_back(Arg->getValue()); + if (!RPaths.empty()) + Config->RPath = llvm::join(RPaths.begin(), RPaths.end(), ":"); + + if (auto *Arg = Args.getLastArg(OPT_m)) { + // Parse ELF{32,64}{LE,BE} and CPU type. + StringRef S = Arg->getValue(); + std::tie(Config->EKind, Config->EMachine) = parseEmulation(S); + Config->Emulation = S; + } + + Config->AllowMultipleDefinition = Args.hasArg(OPT_allow_multiple_definition); + Config->Bsymbolic = Args.hasArg(OPT_Bsymbolic); + Config->BsymbolicFunctions = Args.hasArg(OPT_Bsymbolic_functions); + Config->Demangle = !Args.hasArg(OPT_no_demangle); + Config->DisableVerify = Args.hasArg(OPT_disable_verify); + Config->DiscardAll = Args.hasArg(OPT_discard_all); + Config->DiscardLocals = Args.hasArg(OPT_discard_locals); + Config->DiscardNone = Args.hasArg(OPT_discard_none); + Config->EhFrameHdr = Args.hasArg(OPT_eh_frame_hdr); + Config->EnableNewDtags = !Args.hasArg(OPT_disable_new_dtags); + Config->ExportDynamic = Args.hasArg(OPT_export_dynamic); + Config->FatalWarnings = Args.hasArg(OPT_fatal_warnings); + Config->GcSections = Args.hasArg(OPT_gc_sections); + Config->ICF = Args.hasArg(OPT_icf); + Config->NoGnuUnique = Args.hasArg(OPT_no_gnu_unique); + Config->NoUndefinedVersion = Args.hasArg(OPT_no_undefined_version); + Config->Pie = Args.hasArg(OPT_pie); + Config->PrintGcSections = Args.hasArg(OPT_print_gc_sections); + Config->Relocatable = Args.hasArg(OPT_relocatable); + Config->SaveTemps = Args.hasArg(OPT_save_temps); + Config->Shared = Args.hasArg(OPT_shared); + Config->StripAll = Args.hasArg(OPT_strip_all); + Config->StripDebug = Args.hasArg(OPT_strip_debug); + Config->Threads = Args.hasArg(OPT_threads); + Config->Trace = Args.hasArg(OPT_trace); + Config->Verbose = Args.hasArg(OPT_verbose); + Config->WarnCommon = Args.hasArg(OPT_warn_common); + + Config->DynamicLinker = getString(Args, OPT_dynamic_linker); + Config->Entry = getString(Args, OPT_entry); + Config->Fini = getString(Args, OPT_fini, "_fini"); + Config->Init = getString(Args, OPT_init, "_init"); + Config->LtoAAPipeline = getString(Args, OPT_lto_aa_pipeline); + Config->LtoNewPmPasses = getString(Args, OPT_lto_newpm_passes); + Config->OutputFile = getString(Args, OPT_o); + Config->SoName = getString(Args, OPT_soname); + Config->Sysroot = getString(Args, OPT_sysroot); + + Config->Optimize = getInteger(Args, OPT_O, 1); + Config->LtoO = getInteger(Args, OPT_lto_O, 2); + if (Config->LtoO > 3) + error("invalid optimization level for LTO: " + getString(Args, OPT_lto_O)); + Config->LtoJobs = getInteger(Args, OPT_lto_jobs, 1); + if (Config->LtoJobs == 0) + error("number of threads must be > 0"); + + Config->ZCombreloc = !hasZOption(Args, "nocombreloc"); + Config->ZExecStack = hasZOption(Args, "execstack"); + Config->ZNodelete = hasZOption(Args, "nodelete"); + Config->ZNow = hasZOption(Args, "now"); + Config->ZOrigin = hasZOption(Args, "origin"); + Config->ZRelro = !hasZOption(Args, "norelro"); + + if (Config->Relocatable) + Config->StripAll = false; + + // --strip-all implies --strip-debug. + if (Config->StripAll) + Config->StripDebug = true; + + // Config->Pic is true if we are generating position-independent code. + Config->Pic = Config->Pie || Config->Shared; + + if (auto *Arg = Args.getLastArg(OPT_hash_style)) { + StringRef S = Arg->getValue(); + if (S == "gnu") { + Config->GnuHash = true; + Config->SysvHash = false; + } else if (S == "both") { + Config->GnuHash = true; + } else if (S != "sysv") + error("unknown hash style: " + S); + } + + // Parse --build-id or --build-id= + +.. role:: none +.. role:: partial +.. role:: good + +=============== +Windows support +=============== + +LLD supports Windows operating system. When invoked as ``lld-link.exe`` or with +``-flavor link``, the driver for Windows operating system is used to parse +command line options, and it drives further linking processes. LLD accepts +almost all command line options that the linker shipped with Microsoft Visual +C++ (link.exe) supports. + +The current status is that LLD can link itself on Windows x86/x64 +using Visual C++ 2013 as the compiler. + +Development status +================== + +Driver + :good:`Mostly done`. Some exotic command line options that are not usually + used for application develompent, such as ``/DRIVER``, are not supported. + Options for Windows 8 app store are not recognized too + (e.g. ``/APPCONTAINER``). + +Linking against DLL + :good:`Done`. LLD can read import libraries needed to link against DLL. Both + export-by-name and export-by-ordinal are supported. + +Linking against static library + :good:`Done`. The format of static library (.lib) on Windows is actually the + same as on Unix (.a). LLD can read it. + +Creating DLL + :good:`Done`. LLD creates a DLL if ``/DLL`` option is given. Exported + functions can be specified either via command line (``/EXPORT``) or via + module-definition file (.def). Both export-by-name and export-by-ordinal are + supported. LLD uses Microsoft ``lib.exe`` tool to create an import library + file. + +Windows resource files support + :good:`Done`. If an ``.rc`` file is given, LLD converts the file to a COFF + file using some external commands and link it. Specifically, ``rc.exe`` is + used to compile a resource file (.rc) to a compiled resource (.res) + file. ``rescvt.exe`` is then used to convert a compiled resource file to a + COFF object file section. Both tools are shipped with MSVC. + +Safe Structured Exception Handler (SEH) + :good:`Done` for both x86 and x64. + +Module-definition file + :partial:`Partially done`. LLD currently recognizes these directives: + ``EXPORTS``, ``HEAPSIZE``, ``STACKSIZE``, ``NAME``, and ``VERSION``. + +Debug info + :none:`No progress has been made`. Microsoft linker can interpret the CodeGen + debug info (old-style debug info) and PDB to emit an .pdb file. LLD doesn't + support neither. + + +Building LLD +============ + +Using Visual Studio IDE/MSBuild +------------------------------- + +1. Check out LLVM and LLD from the LLVM SVN repository (or Git mirror), +#. run ``cmake -G "Visual Studio 12" `` from VS command prompt, +#. open LLVM.sln with Visual Studio, and +#. build ``lld`` target in ``lld executables`` folder + +Alternatively, you can use msbuild if you don't like to work in an IDE:: + + msbuild LLVM.sln /m /target:"lld executables\lld" + +MSBuild.exe had been shipped as a component of the .NET framework, but since +2013 it's part of Visual Studio. You can find it at "C:\\Program Files +(x86)\\msbuild". + +You can build LLD as a 64 bit application. To do that, open VS2013 x64 command +prompt and run cmake for "Visual Studio 12 Win64" target. + +Using Ninja +----------- + +1. Check out LLVM and LLD from the LLVM SVN repository (or Git mirror), +#. run ``cmake -G ninja `` from VS command prompt, +#. run ``ninja lld`` Index: vendor/lld/lld-release_390-r280324/docs/C++11.rst =================================================================== --- vendor/lld/lld-release_390-r280324/docs/C++11.rst (nonexistent) +++ vendor/lld/lld-release_390-r280324/docs/C++11.rst (revision 305296) @@ -0,0 +1,9 @@ +C++11 +===== + +Originally, LLD was developed in C++11 unlike the rest of LLVM. Now, all of +LLVM, LLD, and Clang are developed using C++11. See the `LLVM Coding +Standards`_ for details on the precise subset of C++11 supported by the various +host compilers. + +.. _LLVM Coding Standards: http://llvm.org/docs/CodingStandards.html Index: vendor/lld/lld-release_390-r280324/docs/CMakeLists.txt =================================================================== --- vendor/lld/lld-release_390-r280324/docs/CMakeLists.txt (nonexistent) +++ vendor/lld/lld-release_390-r280324/docs/CMakeLists.txt (revision 305296) @@ -0,0 +1,8 @@ +if (LLVM_ENABLE_SPHINX) + if (SPHINX_FOUND) + include(AddSphinxTarget) + if (${SPHINX_OUTPUT_HTML}) + add_sphinx_target(html lld) + endif() + endif() +endif() Property changes on: vendor/lld/lld-release_390-r280324/docs/CMakeLists.txt ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +FreeBSD=%H \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: vendor/lld/lld-release_390-r280324/docs/Driver.rst =================================================================== --- vendor/lld/lld-release_390-r280324/docs/Driver.rst (nonexistent) +++ vendor/lld/lld-release_390-r280324/docs/Driver.rst (revision 305296) @@ -0,0 +1,79 @@ +====== +Driver +====== + +.. contents:: + :local: + +Introduction +============ + +This document describes the lld driver. The purpose of this document is to +describe both the motivation and design goals for the driver, as well as details +of the internal implementation. + +Overview +======== + +The lld driver is designed to support a number of different command line +interfaces. The main interfaces we plan to support are binutils' ld, Apple's +ld, and Microsoft's link.exe. + +Flavors +------- + +Each of these different interfaces is referred to as a flavor. There is also an +extra flavor "core" which is used to exercise the core functionality of the +linker it the test suite. + +* gnu +* darwin +* link +* core + +Selecting a Flavor +^^^^^^^^^^^^^^^^^^ + +There are two different ways to tell lld which flavor to be. They are checked in +order, so the second overrides the first. The first is to symlink :program:`lld` +as :program:`lld-{flavor}` or just :program:`{flavor}`. You can also specify +it as the first command line argument using ``-flavor``:: + + $ lld -flavor gnu + +There is a shortcut for ``-flavor core`` as ``-core``. + + +Adding an Option to an existing Flavor +====================================== + +#. Add the option to the desired :file:`lib/Driver/{flavor}Options.td`. + +#. Add to :cpp:class:`lld::FlavorLinkingContext` a getter and setter method + for the option. + +#. Modify :cpp:func:`lld::FlavorDriver::parse` in :file: + `lib/Driver/{Flavor}Driver.cpp` to call the targetInfo setter + for corresponding to the option. + +#. Modify {Flavor}Reader and {Flavor}Writer to use the new targtInfo option. + + +Adding a Flavor +=============== + +#. Add an entry for the flavor in :file:`include/lld/Driver/Driver.h` to + :cpp:class:`lld::UniversalDriver::Flavor`. + +#. Add an entry in :file:`lib/Driver/UniversalDriver.cpp` to + :cpp:func:`lld::Driver::strToFlavor` and + :cpp:func:`lld::UniversalDriver::link`. + This allows the flavor to be selected via symlink and :option:`-flavor`. + +#. Add a tablegen file called :file:`lib/Driver/{flavor}Options.td` that + describes the options. If the options are a superset of another driver, that + driver's td file can simply be included. The :file:`{flavor}Options.td` file + must also be added to :file:`lib/Driver/CMakeLists.txt`. + +#. Add a ``{flavor}Driver`` as a subclass of :cpp:class:`lld::Driver` + in :file:`lib/Driver/{flavor}Driver.cpp`. Index: vendor/lld/lld-release_390-r280324/docs/README.txt =================================================================== --- vendor/lld/lld-release_390-r280324/docs/README.txt (nonexistent) +++ vendor/lld/lld-release_390-r280324/docs/README.txt (revision 305296) @@ -0,0 +1,12 @@ +lld Documentation +================= + +The lld documentation is written using the Sphinx documentation generator. It is +currently tested with Sphinx 1.1.3. + +We currently use the 'nature' theme and a Beaker inspired structure. + +To rebuild documents into html: + + [/lld/docs]> make html + Property changes on: vendor/lld/lld-release_390-r280324/docs/README.txt ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +FreeBSD=%H \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: vendor/lld/lld-release_390-r280324/docs/_static/favicon.ico =================================================================== Cannot display: file marked as a binary type. svn:mime-type = image/x-icon Property changes on: vendor/lld/lld-release_390-r280324/docs/_static/favicon.ico ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +image/x-icon \ No newline at end of property Index: vendor/lld/lld-release_390-r280324/docs/_templates/indexsidebar.html =================================================================== --- vendor/lld/lld-release_390-r280324/docs/_templates/indexsidebar.html (nonexistent) +++ vendor/lld/lld-release_390-r280324/docs/_templates/indexsidebar.html (revision 305296) @@ -0,0 +1,4 @@ +

Bugs

+ +

lld bugs should be reported at the + LLVM Bugzilla.

Property changes on: vendor/lld/lld-release_390-r280324/docs/_templates/indexsidebar.html ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +FreeBSD=%H \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/html \ No newline at end of property Index: vendor/lld/lld-release_390-r280324/docs/_templates/layout.html =================================================================== --- vendor/lld/lld-release_390-r280324/docs/_templates/layout.html (nonexistent) +++ vendor/lld/lld-release_390-r280324/docs/_templates/layout.html (revision 305296) @@ -0,0 +1,12 @@ +{% extends "!layout.html" %} + +{% block extrahead %} + +{% endblock %} + +{% block rootrellink %} +
  • lld Home | 
  • +{% endblock %} Property changes on: vendor/lld/lld-release_390-r280324/docs/_templates/layout.html ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +FreeBSD=%H \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/html \ No newline at end of property Index: vendor/lld/lld-release_390-r280324/docs/development.rst =================================================================== --- vendor/lld/lld-release_390-r280324/docs/development.rst (nonexistent) +++ vendor/lld/lld-release_390-r280324/docs/development.rst (revision 305296) @@ -0,0 +1,48 @@ +.. _development: + +Development +=========== + +lld is developed as part of the `LLVM `_ project. + +Using C++11 in lld +------------------ + +:doc:`C++11`. + +Creating a Reader +----------------- + +See the :ref:`Creating a Reader ` guide. + + +Modifying the Driver +-------------------- + +See :doc:`Driver`. + + +Debugging +--------- + +You can run lld with ``-mllvm -debug`` command line options to enable debugging +printouts. If you want to enable debug information for some specific pass, you +can run it with ``-mllvm '-debug-only='``, where pass is a name used in +the ``DEBUG_WITH_TYPE()`` macro. + + + +Documentation +------------- + +The project documentation is written in reStructuredText and generated using the +`Sphinx `_ documentation generator. For more +information on writing documentation for the project, see the +:ref:`sphinx_intro`. + +.. toctree:: + :hidden: + + C++11 + Readers + Driver Index: vendor/lld/lld-release_390-r280324/docs/hello.png =================================================================== Cannot display: file marked as a binary type. svn:mime-type = image/png Property changes on: vendor/lld/lld-release_390-r280324/docs/hello.png ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +image/png \ No newline at end of property Index: vendor/lld/lld-release_390-r280324/docs/llvm-theme/layout.html =================================================================== --- vendor/lld/lld-release_390-r280324/docs/llvm-theme/layout.html (nonexistent) +++ vendor/lld/lld-release_390-r280324/docs/llvm-theme/layout.html (revision 305296) @@ -0,0 +1,22 @@ +{# + sphinxdoc/layout.html + ~~~~~~~~~~~~~~~~~~~~~ + + Sphinx layout template for the sphinxdoc theme. + + :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. + :license: BSD, see LICENSE for details. +#} +{% extends "basic/layout.html" %} + +{% block relbar1 %} + +{{ super() }} +{% endblock %} + +{# put the sidebar before the body #} +{% block sidebar1 %}{{ sidebar() }}{% endblock %} +{% block sidebar2 %}{% endblock %} Property changes on: vendor/lld/lld-release_390-r280324/docs/llvm-theme/layout.html ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +FreeBSD=%H \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/html \ No newline at end of property Index: vendor/lld/lld-release_390-r280324/docs/llvm-theme/static/contents.png =================================================================== Cannot display: file marked as a binary type. svn:mime-type = image/png Property changes on: vendor/lld/lld-release_390-r280324/docs/llvm-theme/static/contents.png ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +image/png \ No newline at end of property Index: vendor/lld/lld-release_390-r280324/docs/llvm-theme/static/llvm.css =================================================================== --- vendor/lld/lld-release_390-r280324/docs/llvm-theme/static/llvm.css (nonexistent) +++ vendor/lld/lld-release_390-r280324/docs/llvm-theme/static/llvm.css (revision 305296) @@ -0,0 +1,345 @@ +/* + * sphinxdoc.css_t + * ~~~~~~~~~~~~~~~ + * + * Sphinx stylesheet -- sphinxdoc theme. Originally created by + * Armin Ronacher for Werkzeug. + * + * :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. + * :license: BSD, see LICENSE for details. + * + */ + +@import url("basic.css"); + +/* -- page layout ----------------------------------------------------------- */ + +body { + font-family: 'Lucida Grande', 'Lucida Sans Unicode', 'Geneva', + 'Verdana', sans-serif; + font-size: 14px; + letter-spacing: -0.01em; + line-height: 150%; + text-align: center; + background-color: #BFD1D4; + color: black; + padding: 0; + border: 1px solid #aaa; + + margin: 0px 80px 0px 80px; + min-width: 740px; +} + +div.logo { + background-color: white; + text-align: left; + padding: 10px 10px 15px 15px; +} + +div.document { + background-color: white; + text-align: left; + background-image: url(contents.png); + background-repeat: repeat-x; +} + +div.bodywrapper { + margin: 0 240px 0 0; + border-right: 1px solid #ccc; +} + +div.body { + margin: 0; + padding: 0.5em 20px 20px 20px; +} + +div.related { + font-size: 1em; +} + +div.related ul { + background-image: url(navigation.png); + height: 2em; + border-top: 1px solid #ddd; + border-bottom: 1px solid #ddd; +} + +div.related ul li { + margin: 0; + padding: 0; + height: 2em; + float: left; +} + +div.related ul li.right { + float: right; + margin-right: 5px; +} + +div.related ul li a { + margin: 0; + padding: 0 5px 0 5px; + line-height: 1.75em; + color: #EE9816; +} + +div.related ul li a:hover { + color: #3CA8E7; +} + +div.sphinxsidebarwrapper { + padding: 0; +} + +div.sphinxsidebar { + margin: 0; + padding: 0.5em 15px 15px 0; + width: 210px; + float: right; + font-size: 1em; + text-align: left; +} + +div.sphinxsidebar h3, div.sphinxsidebar h4 { + margin: 1em 0 0.5em 0; + font-size: 1em; + padding: 0.1em 0 0.1em 0.5em; + color: white; + border: 1px solid #86989B; + background-color: #AFC1C4; +} + +div.sphinxsidebar h3 a { + color: white; +} + +div.sphinxsidebar ul { + padding-left: 1.5em; + margin-top: 7px; + padding: 0; + line-height: 130%; +} + +div.sphinxsidebar ul ul { + margin-left: 20px; +} + +div.footer { + background-color: #E3EFF1; + color: #86989B; + padding: 3px 8px 3px 0; + clear: both; + font-size: 0.8em; + text-align: right; +} + +div.footer a { + color: #86989B; + text-decoration: underline; +} + +/* -- body styles ----------------------------------------------------------- */ + +p { + margin: 0.8em 0 0.5em 0; +} + +a { + color: #CA7900; + text-decoration: none; +} + +a:hover { + color: #2491CF; +} + +div.body a { + text-decoration: underline; +} + +h1 { + margin: 0; + padding: 0.7em 0 0.3em 0; + font-size: 1.5em; + color: #11557C; +} + +h2 { + margin: 1.3em 0 0.2em 0; + font-size: 1.35em; + padding: 0; +} + +h3 { + margin: 1em 0 -0.3em 0; + font-size: 1.2em; +} + +div.body h1 a, div.body h2 a, div.body h3 a, div.body h4 a, div.body h5 a, div.body h6 a { + color: black!important; +} + +h1 a.anchor, h2 a.anchor, h3 a.anchor, h4 a.anchor, h5 a.anchor, h6 a.anchor { + display: none; + margin: 0 0 0 0.3em; + padding: 0 0.2em 0 0.2em; + color: #aaa!important; +} + +h1:hover a.anchor, h2:hover a.anchor, h3:hover a.anchor, h4:hover a.anchor, +h5:hover a.anchor, h6:hover a.anchor { + display: inline; +} + +h1 a.anchor:hover, h2 a.anchor:hover, h3 a.anchor:hover, h4 a.anchor:hover, +h5 a.anchor:hover, h6 a.anchor:hover { + color: #777; + background-color: #eee; +} + +a.headerlink { + color: #c60f0f!important; + font-size: 1em; + margin-left: 6px; + padding: 0 4px 0 4px; + text-decoration: none!important; +} + +a.headerlink:hover { + background-color: #ccc; + color: white!important; +} + +cite, code, tt { + font-family: 'Consolas', 'Deja Vu Sans Mono', + 'Bitstream Vera Sans Mono', monospace; + font-size: 0.95em; + letter-spacing: 0.01em; +} + +tt { + background-color: #f2f2f2; + border-bottom: 1px solid #ddd; + color: #333; +} + +tt.descname, tt.descclassname, tt.xref { + border: 0; +} + +hr { + border: 1px solid #abc; + margin: 2em; +} + +a tt { + border: 0; + color: #CA7900; +} + +a tt:hover { + color: #2491CF; +} + +pre { + font-family: 'Consolas', 'Deja Vu Sans Mono', + 'Bitstream Vera Sans Mono', monospace; + font-size: 0.95em; + letter-spacing: 0.015em; + line-height: 120%; + padding: 0.5em; + border: 1px solid #ccc; + background-color: #f8f8f8; +} + +pre a { + color: inherit; + text-decoration: underline; +} + +td.linenos pre { + padding: 0.5em 0; +} + +div.quotebar { + background-color: #f8f8f8; + max-width: 250px; + float: right; + padding: 2px 7px; + border: 1px solid #ccc; +} + +div.topic { + background-color: #f8f8f8; +} + +table { + border-collapse: collapse; + margin: 0 -0.5em 0 -0.5em; +} + +table td, table th { + padding: 0.2em 0.5em 0.2em 0.5em; +} + +div.admonition, div.warning { + font-size: 0.9em; + margin: 1em 0 1em 0; + border: 1px solid #86989B; + background-color: #f7f7f7; + padding: 0; +} + +div.admonition p, div.warning p { + margin: 0.5em 1em 0.5em 1em; + padding: 0; +} + +div.admonition pre, div.warning pre { + margin: 0.4em 1em 0.4em 1em; +} + +div.admonition p.admonition-title, +div.warning p.admonition-title { + margin: 0; + padding: 0.1em 0 0.1em 0.5em; + color: white; + border-bottom: 1px solid #86989B; + font-weight: bold; + background-color: #AFC1C4; +} + +div.warning { + border: 1px solid #940000; +} + +div.warning p.admonition-title { + background-color: #CF0000; + border-bottom-color: #940000; +} + +div.admonition ul, div.admonition ol, +div.warning ul, div.warning ol { + margin: 0.1em 0.5em 0.5em 3em; + padding: 0; +} + +div.versioninfo { + margin: 1em 0 0 0; + border: 1px solid #ccc; + background-color: #DDEAF0; + padding: 8px; + line-height: 1.3em; + font-size: 0.9em; +} + +.viewcode-back { + font-family: 'Lucida Grande', 'Lucida Sans Unicode', 'Geneva', + 'Verdana', sans-serif; +} + +div.viewcode-block:target { + background-color: #f4debf; + border-top: 1px solid #ac9; + border-bottom: 1px solid #ac9; +} Property changes on: vendor/lld/lld-release_390-r280324/docs/llvm-theme/static/llvm.css ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +FreeBSD=%H \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/css \ No newline at end of property Index: vendor/lld/lld-release_390-r280324/docs/llvm-theme/static/logo.png =================================================================== Cannot display: file marked as a binary type. svn:mime-type = image/png Property changes on: vendor/lld/lld-release_390-r280324/docs/llvm-theme/static/logo.png ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +image/png \ No newline at end of property Index: vendor/lld/lld-release_390-r280324/docs/llvm-theme/static/navigation.png =================================================================== Cannot display: file marked as a binary type. svn:mime-type = image/png Property changes on: vendor/lld/lld-release_390-r280324/docs/llvm-theme/static/navigation.png ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +image/png \ No newline at end of property Index: vendor/lld/lld-release_390-r280324/docs/llvm-theme/theme.conf =================================================================== --- vendor/lld/lld-release_390-r280324/docs/llvm-theme/theme.conf (nonexistent) +++ vendor/lld/lld-release_390-r280324/docs/llvm-theme/theme.conf (revision 305296) @@ -0,0 +1,4 @@ +[theme] +inherit = basic +stylesheet = llvm.css +pygments_style = friendly Property changes on: vendor/lld/lld-release_390-r280324/docs/llvm-theme/theme.conf ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +FreeBSD=%H \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: vendor/lld/lld-release_390-r280324/docs/make.bat =================================================================== --- vendor/lld/lld-release_390-r280324/docs/make.bat (nonexistent) +++ vendor/lld/lld-release_390-r280324/docs/make.bat (revision 305296) @@ -0,0 +1,190 @@ +@ECHO OFF + +REM Command file for Sphinx documentation + +if "%SPHINXBUILD%" == "" ( + set SPHINXBUILD=sphinx-build +) +set BUILDDIR=_build +set ALLSPHINXOPTS=-d %BUILDDIR%/doctrees %SPHINXOPTS% . +set I18NSPHINXOPTS=%SPHINXOPTS% . +if NOT "%PAPER%" == "" ( + set ALLSPHINXOPTS=-D latex_paper_size=%PAPER% %ALLSPHINXOPTS% + set I18NSPHINXOPTS=-D latex_paper_size=%PAPER% %I18NSPHINXOPTS% +) + +if "%1" == "" goto help + +if "%1" == "help" ( + :help + echo.Please use `make ^` where ^ is one of + echo. html to make standalone HTML files + echo. dirhtml to make HTML files named index.html in directories + echo. singlehtml to make a single large HTML file + echo. pickle to make pickle files + echo. json to make JSON files + echo. htmlhelp to make HTML files and a HTML help project + echo. qthelp to make HTML files and a qthelp project + echo. devhelp to make HTML files and a Devhelp project + echo. epub to make an epub + echo. latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter + echo. text to make text files + echo. man to make manual pages + echo. texinfo to make Texinfo files + echo. gettext to make PO message catalogs + echo. changes to make an overview over all changed/added/deprecated items + echo. linkcheck to check all external links for integrity + echo. doctest to run all doctests embedded in the documentation if enabled + goto end +) + +if "%1" == "clean" ( + for /d %%i in (%BUILDDIR%\*) do rmdir /q /s %%i + del /q /s %BUILDDIR%\* + goto end +) + +if "%1" == "html" ( + %SPHINXBUILD% -b html %ALLSPHINXOPTS% %BUILDDIR%/html + if errorlevel 1 exit /b 1 + echo. + echo.Build finished. The HTML pages are in %BUILDDIR%/html. + goto end +) + +if "%1" == "dirhtml" ( + %SPHINXBUILD% -b dirhtml %ALLSPHINXOPTS% %BUILDDIR%/dirhtml + if errorlevel 1 exit /b 1 + echo. + echo.Build finished. The HTML pages are in %BUILDDIR%/dirhtml. + goto end +) + +if "%1" == "singlehtml" ( + %SPHINXBUILD% -b singlehtml %ALLSPHINXOPTS% %BUILDDIR%/singlehtml + if errorlevel 1 exit /b 1 + echo. + echo.Build finished. The HTML pages are in %BUILDDIR%/singlehtml. + goto end +) + +if "%1" == "pickle" ( + %SPHINXBUILD% -b pickle %ALLSPHINXOPTS% %BUILDDIR%/pickle + if errorlevel 1 exit /b 1 + echo. + echo.Build finished; now you can process the pickle files. + goto end +) + +if "%1" == "json" ( + %SPHINXBUILD% -b json %ALLSPHINXOPTS% %BUILDDIR%/json + if errorlevel 1 exit /b 1 + echo. + echo.Build finished; now you can process the JSON files. + goto end +) + +if "%1" == "htmlhelp" ( + %SPHINXBUILD% -b htmlhelp %ALLSPHINXOPTS% %BUILDDIR%/htmlhelp + if errorlevel 1 exit /b 1 + echo. + echo.Build finished; now you can run HTML Help Workshop with the ^ +.hhp project file in %BUILDDIR%/htmlhelp. + goto end +) + +if "%1" == "qthelp" ( + %SPHINXBUILD% -b qthelp %ALLSPHINXOPTS% %BUILDDIR%/qthelp + if errorlevel 1 exit /b 1 + echo. + echo.Build finished; now you can run "qcollectiongenerator" with the ^ +.qhcp project file in %BUILDDIR%/qthelp, like this: + echo.^> qcollectiongenerator %BUILDDIR%\qthelp\lld.qhcp + echo.To view the help file: + echo.^> assistant -collectionFile %BUILDDIR%\qthelp\lld.ghc + goto end +) + +if "%1" == "devhelp" ( + %SPHINXBUILD% -b devhelp %ALLSPHINXOPTS% %BUILDDIR%/devhelp + if errorlevel 1 exit /b 1 + echo. + echo.Build finished. + goto end +) + +if "%1" == "epub" ( + %SPHINXBUILD% -b epub %ALLSPHINXOPTS% %BUILDDIR%/epub + if errorlevel 1 exit /b 1 + echo. + echo.Build finished. The epub file is in %BUILDDIR%/epub. + goto end +) + +if "%1" == "latex" ( + %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex + if errorlevel 1 exit /b 1 + echo. + echo.Build finished; the LaTeX files are in %BUILDDIR%/latex. + goto end +) + +if "%1" == "text" ( + %SPHINXBUILD% -b text %ALLSPHINXOPTS% %BUILDDIR%/text + if errorlevel 1 exit /b 1 + echo. + echo.Build finished. The text files are in %BUILDDIR%/text. + goto end +) + +if "%1" == "man" ( + %SPHINXBUILD% -b man %ALLSPHINXOPTS% %BUILDDIR%/man + if errorlevel 1 exit /b 1 + echo. + echo.Build finished. The manual pages are in %BUILDDIR%/man. + goto end +) + +if "%1" == "texinfo" ( + %SPHINXBUILD% -b texinfo %ALLSPHINXOPTS% %BUILDDIR%/texinfo + if errorlevel 1 exit /b 1 + echo. + echo.Build finished. The Texinfo files are in %BUILDDIR%/texinfo. + goto end +) + +if "%1" == "gettext" ( + %SPHINXBUILD% -b gettext %I18NSPHINXOPTS% %BUILDDIR%/locale + if errorlevel 1 exit /b 1 + echo. + echo.Build finished. The message catalogs are in %BUILDDIR%/locale. + goto end +) + +if "%1" == "changes" ( + %SPHINXBUILD% -b changes %ALLSPHINXOPTS% %BUILDDIR%/changes + if errorlevel 1 exit /b 1 + echo. + echo.The overview file is in %BUILDDIR%/changes. + goto end +) + +if "%1" == "linkcheck" ( + %SPHINXBUILD% -b linkcheck %ALLSPHINXOPTS% %BUILDDIR%/linkcheck + if errorlevel 1 exit /b 1 + echo. + echo.Link check complete; look for any errors in the above output ^ +or in %BUILDDIR%/linkcheck/output.txt. + goto end +) + +if "%1" == "doctest" ( + %SPHINXBUILD% -b doctest %ALLSPHINXOPTS% %BUILDDIR%/doctest + if errorlevel 1 exit /b 1 + echo. + echo.Testing of doctests in the sources finished, look at the ^ +results in %BUILDDIR%/doctest/output.txt. + goto end +) + +:end Index: vendor/lld/lld-release_390-r280324/docs/sphinx_intro.rst =================================================================== --- vendor/lld/lld-release_390-r280324/docs/sphinx_intro.rst (nonexistent) +++ vendor/lld/lld-release_390-r280324/docs/sphinx_intro.rst (revision 305296) @@ -0,0 +1,147 @@ +.. _sphinx_intro: + +Sphinx Introduction for LLVM Developers +======================================= + +This document is intended as a short and simple introduction to the Sphinx +documentation generation system for LLVM developers. + +Quickstart +---------- + +To get started writing documentation, you will need to: + + 1. Have the Sphinx tools :ref:`installed `. + + 2. Understand how to :ref:`build the documentation + `. + + 3. Start :ref:`writing documentation `! + +.. _installing_sphinx: + +Installing Sphinx +~~~~~~~~~~~~~~~~~ + +You should be able to install Sphinx using the standard Python package +installation tool ``easy_install``, as follows:: + + $ sudo easy_install sphinx + Searching for sphinx + Reading http://pypi.python.org/simple/sphinx/ + Reading http://sphinx.pocoo.org/ + Best match: Sphinx 1.1.3 + ... more lines here .. + +If you do not have root access (or otherwise want to avoid installing Sphinx in +system directories) see the section on :ref:`installing_sphinx_in_a_venv` . + +If you do not have the ``easy_install`` tool on your system, you should be able +to install it using: + + Linux + Use your distribution's standard package management tool to install it, + i.e., ``apt-get install easy_install`` or ``yum install easy_install``. + + Mac OS X + All modern Mac OS X systems come with ``easy_install`` as part of the base + system. + + Windows + See the `setuptools `_ package web + page for instructions. + + +.. _building_the_documentation: + +Building the documentation +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +In order to build the documentation, all you should need to do is change to the +``docs`` directory and invoke make as follows:: + + $ cd path/to/project/docs + $ make html + +Note that on Windows there is a ``make.bat`` command in the docs directory which +supplies the same interface as the ``Makefile``. + +That command will invoke ``sphinx-build`` with the appropriate options for the +project, and generate the HTML documentation in a ``_build`` subdirectory. You +can browse it starting from the index page by visiting +``_build/html/index.html``. + +Sphinx supports a wide variety of generation formats (including LaTeX, man +pages, and plain text). The ``Makefile`` includes a number of convenience +targets for invoking ``sphinx-build`` appropriately, the common ones are: + + make html + Generate the HTML output. + + make latexpdf + Generate LaTeX documentation and convert to a PDF. + + make man + Generate man pages. + + +.. _writing_documentation: + +Writing documentation +~~~~~~~~~~~~~~~~~~~~~ + +The documentation itself is written in the reStructuredText (ReST) format, and Sphinx +defines additional tags to support features like cross-referencing. + +The ReST format itself is organized around documents mostly being readable +plaintext documents. You should generally be able to write new documentation +easily just by following the style of the existing documentation. + +If you want to understand the formatting of the documents more, the best place +to start is Sphinx's own `ReST Primer `_. + + +Learning More +------------- + +If you want to learn more about the Sphinx system, the best place to start is +the Sphinx documentation itself, available `here +`_. + + +.. _installing_sphinx_in_a_venv: + +Installing Sphinx in a Virtual Environment +------------------------------------------ + +Most Python developers prefer to work with tools inside a *virtualenv* (virtual +environment) instance, which functions as an application sandbox. This avoids +polluting your system installation with different packages used by various +projects (and ensures that dependencies for different packages don't conflict +with one another). Of course, you need to first have the virtualenv software +itself which generally would be installed at the system level:: + + $ sudo easy_install virtualenv + +but after that you no longer need to install additional packages in the system +directories. + +Once you have the *virtualenv* tool itself installed, you can create a +virtualenv for Sphinx using:: + + $ virtualenv ~/my-sphinx-install + New python executable in /Users/dummy/my-sphinx-install/bin/python + Installing setuptools............done. + Installing pip...............done. + + $ ~/my-sphinx-install/bin/easy_install sphinx + ... install messages here ... + +and from now on you can "activate" the *virtualenv* using:: + + $ source ~/my-sphinx-install/bin/activate + +which will change your PATH to ensure the sphinx-build tool from inside the +virtual environment will be used. See the `virtualenv website +`_ for more information on using +virtual environments. Index: vendor/lld/lld-release_390-r280324/test/ELF/tls-i686.s =================================================================== --- vendor/lld/lld-release_390-r280324/test/ELF/tls-i686.s (nonexistent) +++ vendor/lld/lld-release_390-r280324/test/ELF/tls-i686.s (revision 305296) @@ -0,0 +1,69 @@ +// REQUIRES: x86 +// RUN: llvm-mc -filetype=obj -triple=i686-pc-linux %s -o %t +// RUN: ld.lld %t -o %tout +// RUN: ld.lld %t -shared -o %tsharedout +// RUN: llvm-objdump -d %tout | FileCheck %s --check-prefix=DIS +// RUN: llvm-readobj -r %tout | FileCheck %s --check-prefix=RELOC +// RUN: llvm-objdump -d %tsharedout | FileCheck %s --check-prefix=DISSHARED +// RUN: llvm-readobj -r %tsharedout | FileCheck %s --check-prefix=RELOCSHARED + +.section ".tdata", "awT", @progbits +.globl var +.globl var1 +var: +.long 0 +var1: +.long 1 + +.section test, "awx" +.global _start +_start: + movl $var@tpoff, %edx + movl %gs:0, %ecx + subl %edx, %eax + movl $var1@tpoff, %edx + movl %gs:0, %ecx + subl %edx, %eax + + movl %gs:0, %ecx + leal var@ntpoff(%ecx), %eax + movl %gs:0, %ecx + leal var1@ntpoff+123(%ecx), %eax + +// DIS: Disassembly of section test: +// DIS-NEXT: _start: +// DIS-NEXT: 12000: ba 08 00 00 00 movl $8, %edx +// DIS-NEXT: 12005: 65 8b 0d 00 00 00 00 movl %gs:0, %ecx +// DIS-NEXT: 1200c: 29 d0 subl %edx, %eax +// DIS-NEXT: 1200e: ba 04 00 00 00 movl $4, %edx +// DIS-NEXT: 12013: 65 8b 0d 00 00 00 00 movl %gs:0, %ecx +// DIS-NEXT: 1201a: 29 d0 subl %edx, %eax +// DIS-NEXT: 1201c: 65 8b 0d 00 00 00 00 movl %gs:0, %ecx +// DIS-NEXT: 12023: 8d 81 f8 ff ff ff leal -8(%ecx), %eax +// DIS-NEXT: 12029: 65 8b 0d 00 00 00 00 movl %gs:0, %ecx +// DIS-NEXT: 12030: 8d 81 77 00 00 00 leal 119(%ecx), %eax + +// RELOC: Relocations [ +// RELOC-NEXT: ] + +// DISSHARED: Disassembly of section test: +// DISSHARED-NEXT: _start: +// DISSHARED-NEXT: 2000: ba 00 00 00 00 movl $0, %edx +// DISSHARED-NEXT: 2005: 65 8b 0d 00 00 00 00 movl %gs:0, %ecx +// DISSHARED-NEXT: 200c: 29 d0 subl %edx, %eax +// DISSHARED-NEXT: 200e: ba 00 00 00 00 movl $0, %edx +// DISSHARED-NEXT: 2013: 65 8b 0d 00 00 00 00 movl %gs:0, %ecx +// DISSHARED-NEXT: 201a: 29 d0 subl %edx, %eax +// DISSHARED-NEXT: 201c: 65 8b 0d 00 00 00 00 movl %gs:0, %ecx +// DISSHARED-NEXT: 2023: 8d 81 00 00 00 00 leal (%ecx), %eax +// DISSHARED-NEXT: 2029: 65 8b 0d 00 00 00 00 movl %gs:0, %ecx +// DISSHARED-NEXT: 2030: 8d 81 7b 00 00 00 leal 123(%ecx), %eax + +// RELOCSHARED: Relocations [ +// RELOCSHARED-NEXT: Section (4) .rel.dyn { +// RELOCSHARED-NEXT: 0x2001 R_386_TLS_TPOFF32 var 0x0 +// RELOCSHARED-NEXT: 0x2025 R_386_TLS_TPOFF var 0x0 +// RELOCSHARED-NEXT: 0x200F R_386_TLS_TPOFF32 var1 0x0 +// RELOCSHARED-NEXT: 0x2032 R_386_TLS_TPOFF var1 0x0 +// RELOCSHARED-NEXT: } +// RELOCSHARED-NEXT: ] Property changes on: vendor/lld/lld-release_390-r280324/test/ELF/tls-i686.s ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +FreeBSD=%H \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: vendor/lld/lld-release_390-r280324/test/ELF/Inputs/aarch64-copy2.s =================================================================== --- vendor/lld/lld-release_390-r280324/test/ELF/Inputs/aarch64-copy2.s (nonexistent) +++ vendor/lld/lld-release_390-r280324/test/ELF/Inputs/aarch64-copy2.s (revision 305296) @@ -0,0 +1,5 @@ + .global foo + .type foo, @function +foo: + .global bar +bar: Property changes on: vendor/lld/lld-release_390-r280324/test/ELF/Inputs/aarch64-copy2.s ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +FreeBSD=%H \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: vendor/lld/lld-release_390-r280324/test/ELF/Inputs/aarch64-tls-gdie.s =================================================================== --- vendor/lld/lld-release_390-r280324/test/ELF/Inputs/aarch64-tls-gdie.s (nonexistent) +++ vendor/lld/lld-release_390-r280324/test/ELF/Inputs/aarch64-tls-gdie.s (revision 305296) @@ -0,0 +1,4 @@ + .section .tdata,"awT",@progbits + .globl a +a: + .word 42 Property changes on: vendor/lld/lld-release_390-r280324/test/ELF/Inputs/aarch64-tls-gdie.s ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +FreeBSD=%H \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: vendor/lld/lld-release_390-r280324/test/ELF/Inputs/abs-hidden.s =================================================================== --- vendor/lld/lld-release_390-r280324/test/ELF/Inputs/abs-hidden.s (nonexistent) +++ vendor/lld/lld-release_390-r280324/test/ELF/Inputs/abs-hidden.s (revision 305296) @@ -0,0 +1,3 @@ +.global foo +.hidden foo +foo = 0x42 Property changes on: vendor/lld/lld-release_390-r280324/test/ELF/Inputs/abs-hidden.s ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +FreeBSD=%H \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: vendor/lld/lld-release_390-r280324/test/ELF/Inputs/allow-shlib-undefined.s =================================================================== --- vendor/lld/lld-release_390-r280324/test/ELF/Inputs/allow-shlib-undefined.s (nonexistent) +++ vendor/lld/lld-release_390-r280324/test/ELF/Inputs/allow-shlib-undefined.s (revision 305296) @@ -0,0 +1,3 @@ +.globl _shared +_shared: + callq _unresolved@PLT Property changes on: vendor/lld/lld-release_390-r280324/test/ELF/Inputs/allow-shlib-undefined.s ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +FreeBSD=%H \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: vendor/lld/lld-release_390-r280324/test/ELF/Inputs/archive.s =================================================================== --- vendor/lld/lld-release_390-r280324/test/ELF/Inputs/archive.s (nonexistent) +++ vendor/lld/lld-release_390-r280324/test/ELF/Inputs/archive.s (revision 305296) @@ -0,0 +1,5 @@ +.globl _start +_start: + +.globl end +end: Property changes on: vendor/lld/lld-release_390-r280324/test/ELF/Inputs/archive.s ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +FreeBSD=%H \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: vendor/lld/lld-release_390-r280324/test/ELF/Inputs/arm-plt-reloc.s =================================================================== --- vendor/lld/lld-release_390-r280324/test/ELF/Inputs/arm-plt-reloc.s (nonexistent) +++ vendor/lld/lld-release_390-r280324/test/ELF/Inputs/arm-plt-reloc.s (revision 305296) @@ -0,0 +1,14 @@ +.text + .align 2 + .globl func1 + .type func1,%function +func1: + bx lr + .globl func2 + .type func2,%function +func2: + bx lr + .globl func3 + .type func3,%function +func3: + bx lr Property changes on: vendor/lld/lld-release_390-r280324/test/ELF/Inputs/arm-plt-reloc.s ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +FreeBSD=%H \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: vendor/lld/lld-release_390-r280324/test/ELF/Inputs/arm-thumb-blx-targets.s =================================================================== --- vendor/lld/lld-release_390-r280324/test/ELF/Inputs/arm-thumb-blx-targets.s (nonexistent) +++ vendor/lld/lld-release_390-r280324/test/ELF/Inputs/arm-thumb-blx-targets.s (revision 305296) @@ -0,0 +1,36 @@ + .syntax unified + .arm + .section .R_ARM_CALL24_callee_low, "ax",%progbits + .align 2 + .globl callee_low + .type callee_low,%function +callee_low: + bx lr + + .section .R_ARM_CALL24_callee_thumb_low, "ax",%progbits + .balign 0x100 + .thumb + .type callee_thumb_low,%function + .globl callee_thumb_low +callee_thumb_low: + bx lr + + .section .R_ARM_CALL24_callee_high, "ax",%progbits + .balign 0x100 + .arm + .globl callee_high + .type callee_high,%function +callee_high: + bx lr + + .section .R_ARM_CALL24_callee_thumb_high, "ax",%progbits + .balign 0x100 + .thumb + .type callee_thumb_high,%function + .globl callee_thumb_high +callee_thumb_high: + bx lr + + .globl blx_far + .type blx_far, %function +blx_far = 0x1010018 Property changes on: vendor/lld/lld-release_390-r280324/test/ELF/Inputs/arm-thumb-blx-targets.s ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +FreeBSD=%H \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: vendor/lld/lld-release_390-r280324/test/ELF/Inputs/arm-thumb-narrow-branch.s =================================================================== --- vendor/lld/lld-release_390-r280324/test/ELF/Inputs/arm-thumb-narrow-branch.s (nonexistent) +++ vendor/lld/lld-release_390-r280324/test/ELF/Inputs/arm-thumb-narrow-branch.s (revision 305296) @@ -0,0 +1,18 @@ +// This input must be assembled by the GNU assembler, as llvm-mc does not emit +// the R_ARM_JUMP11 relocation for a Thumb narrow branch. This is permissible +// by the ABI for the ARM architecture as the range of the Thumb narrow branch +// is short enough (+- 2048 bytes) that widespread use would be impractical. +// +// The test case will use a pre compiled object arm-thumb-narrow-branch.o + .syntax unified + .section .caller, "ax",%progbits + .thumb + .align 2 + .type callers,%function + .globl callers +callers: + b.n callee_low_far + b.n callee_low + b.n callee_high + b.n callee_high_far + bx lr Property changes on: vendor/lld/lld-release_390-r280324/test/ELF/Inputs/arm-thumb-narrow-branch.s ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +FreeBSD=%H \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: vendor/lld/lld-release_390-r280324/test/ELF/Inputs/conflict.s =================================================================== --- vendor/lld/lld-release_390-r280324/test/ELF/Inputs/conflict.s (nonexistent) +++ vendor/lld/lld-release_390-r280324/test/ELF/Inputs/conflict.s (revision 305296) @@ -0,0 +1,7 @@ +.globl _Z3muldd, foo, baz +_Z3muldd: +foo: +baz: + mov $60, %rax + mov $42, %rdi + syscall Property changes on: vendor/lld/lld-release_390-r280324/test/ELF/Inputs/conflict.s ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +FreeBSD=%H \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: vendor/lld/lld-release_390-r280324/test/ELF/Inputs/copy-in-shared.s =================================================================== --- vendor/lld/lld-release_390-r280324/test/ELF/Inputs/copy-in-shared.s (nonexistent) +++ vendor/lld/lld-release_390-r280324/test/ELF/Inputs/copy-in-shared.s (revision 305296) @@ -0,0 +1,4 @@ +.type foo, @object +.global foo +foo: +.size foo, 4 Property changes on: vendor/lld/lld-release_390-r280324/test/ELF/Inputs/copy-in-shared.s ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +FreeBSD=%H \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: vendor/lld/lld-release_390-r280324/test/ELF/Inputs/copy-rel-corrupted.s =================================================================== --- vendor/lld/lld-release_390-r280324/test/ELF/Inputs/copy-rel-corrupted.s (nonexistent) +++ vendor/lld/lld-release_390-r280324/test/ELF/Inputs/copy-rel-corrupted.s (revision 305296) @@ -0,0 +1,4 @@ +.type x,@object +.globl x +x: +.size x, 0 Property changes on: vendor/lld/lld-release_390-r280324/test/ELF/Inputs/copy-rel-corrupted.s ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +FreeBSD=%H \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: vendor/lld/lld-release_390-r280324/test/ELF/Inputs/copy-rel-pie.s =================================================================== --- vendor/lld/lld-release_390-r280324/test/ELF/Inputs/copy-rel-pie.s (nonexistent) +++ vendor/lld/lld-release_390-r280324/test/ELF/Inputs/copy-rel-pie.s (revision 305296) @@ -0,0 +1,9 @@ +.global foo +.type foo, @object +.size foo, 4 +foo: +.long 0 + +.global bar +.type bar, @function +bar: Property changes on: vendor/lld/lld-release_390-r280324/test/ELF/Inputs/copy-rel-pie.s ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +FreeBSD=%H \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: vendor/lld/lld-release_390-r280324/test/ELF/Inputs/ctors_dtors_priority1.s =================================================================== --- vendor/lld/lld-release_390-r280324/test/ELF/Inputs/ctors_dtors_priority1.s (nonexistent) +++ vendor/lld/lld-release_390-r280324/test/ELF/Inputs/ctors_dtors_priority1.s (revision 305296) @@ -0,0 +1,5 @@ +.section .ctors, "aw", @progbits + .byte 0xA1 + +.section .dtors, "aw", @progbits + .byte 0xA2 Property changes on: vendor/lld/lld-release_390-r280324/test/ELF/Inputs/ctors_dtors_priority1.s ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +FreeBSD=%H \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: vendor/lld/lld-release_390-r280324/test/ELF/Inputs/ctors_dtors_priority2.s =================================================================== --- vendor/lld/lld-release_390-r280324/test/ELF/Inputs/ctors_dtors_priority2.s (nonexistent) +++ vendor/lld/lld-release_390-r280324/test/ELF/Inputs/ctors_dtors_priority2.s (revision 305296) @@ -0,0 +1,5 @@ +.section .ctors, "aw", @progbits + .byte 0xB1 + +.section .dtors, "aw", @progbits + .byte 0xB2 Property changes on: vendor/lld/lld-release_390-r280324/test/ELF/Inputs/ctors_dtors_priority2.s ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +FreeBSD=%H \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: vendor/lld/lld-release_390-r280324/test/ELF/Inputs/ctors_dtors_priority3.s =================================================================== --- vendor/lld/lld-release_390-r280324/test/ELF/Inputs/ctors_dtors_priority3.s (nonexistent) +++ vendor/lld/lld-release_390-r280324/test/ELF/Inputs/ctors_dtors_priority3.s (revision 305296) @@ -0,0 +1,5 @@ +.section .ctors, "aw", @progbits + .byte 0xC1 + +.section .dtors, "aw", @progbits + .byte 0xC2 Property changes on: vendor/lld/lld-release_390-r280324/test/ELF/Inputs/ctors_dtors_priority3.s ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +FreeBSD=%H \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: vendor/lld/lld-release_390-r280324/test/ELF/Inputs/duplicated-plt-entry.s =================================================================== --- vendor/lld/lld-release_390-r280324/test/ELF/Inputs/duplicated-plt-entry.s (nonexistent) +++ vendor/lld/lld-release_390-r280324/test/ELF/Inputs/duplicated-plt-entry.s (revision 305296) @@ -0,0 +1,3 @@ +.global bar +.type bar, @gnu_indirect_function +bar: Property changes on: vendor/lld/lld-release_390-r280324/test/ELF/Inputs/duplicated-plt-entry.s ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +FreeBSD=%H \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: vendor/lld/lld-release_390-r280324/test/ELF/Inputs/dynamic-reloc-weak.s =================================================================== --- vendor/lld/lld-release_390-r280324/test/ELF/Inputs/dynamic-reloc-weak.s (nonexistent) +++ vendor/lld/lld-release_390-r280324/test/ELF/Inputs/dynamic-reloc-weak.s (revision 305296) @@ -0,0 +1,11 @@ + .type sym1,@function + .global sym1 +sym1: + + .type sym2,@function + .global sym2 +sym2: + + .type sym3,@function + .global sym3 +sym3: Property changes on: vendor/lld/lld-release_390-r280324/test/ELF/Inputs/dynamic-reloc-weak.s ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +FreeBSD=%H \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: vendor/lld/lld-release_390-r280324/test/ELF/Inputs/ehframe-relocation.s =================================================================== --- vendor/lld/lld-release_390-r280324/test/ELF/Inputs/ehframe-relocation.s (nonexistent) +++ vendor/lld/lld-release_390-r280324/test/ELF/Inputs/ehframe-relocation.s (revision 305296) @@ -0,0 +1,2 @@ + .cfi_startproc + .cfi_endproc Property changes on: vendor/lld/lld-release_390-r280324/test/ELF/Inputs/ehframe-relocation.s ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +FreeBSD=%H \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: vendor/lld/lld-release_390-r280324/test/ELF/Inputs/empty-ver.ver =================================================================== --- vendor/lld/lld-release_390-r280324/test/ELF/Inputs/empty-ver.ver (nonexistent) +++ vendor/lld/lld-release_390-r280324/test/ELF/Inputs/empty-ver.ver (revision 305296) @@ -0,0 +1,2 @@ +ver { +}; Index: vendor/lld/lld-release_390-r280324/test/ELF/Inputs/far-arm-abs.s =================================================================== --- vendor/lld/lld-release_390-r280324/test/ELF/Inputs/far-arm-abs.s (nonexistent) +++ vendor/lld/lld-release_390-r280324/test/ELF/Inputs/far-arm-abs.s (revision 305296) @@ -0,0 +1,13 @@ +.global far +.type far,%function +far = 0x201001c + +.global too_far1 +.type too_far1,%function +too_far1 = 0x2020008 +.global too_far2 +.type too_far2,%function +too_far2 = 0x202000c +.global too_far3 +.type too_far3,%function +too_far3 = 0x2020010 Property changes on: vendor/lld/lld-release_390-r280324/test/ELF/Inputs/far-arm-abs.s ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +FreeBSD=%H \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: vendor/lld/lld-release_390-r280324/test/ELF/Inputs/far-arm-thumb-abs.s =================================================================== --- vendor/lld/lld-release_390-r280324/test/ELF/Inputs/far-arm-thumb-abs.s (nonexistent) +++ vendor/lld/lld-release_390-r280324/test/ELF/Inputs/far-arm-thumb-abs.s (revision 305296) @@ -0,0 +1,24 @@ +.global far_cond +.type far_cond,%function +far_cond = 0x110023 +.global far_uncond +.type far_uncond,%function +far_uncond = 0x101001b + +.global too_far1 +.type too_far1,%function +too_far1 = 0x1020005 +.global too_far2 +.type too_far1,%function +too_far2 = 0x1020009 +.global too_far3 +.type too_far3,%function +too_far3 = 0x12000d + +.global blx_far +.type blx_far, %function +blx_far = 0x2010025 + +.global blx_far2 +.type blx_far2, %function +blx_far2 = 0x2010029 Property changes on: vendor/lld/lld-release_390-r280324/test/ELF/Inputs/far-arm-thumb-abs.s ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +FreeBSD=%H \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: vendor/lld/lld-release_390-r280324/test/ELF/Inputs/gc-sections-weak.s =================================================================== --- vendor/lld/lld-release_390-r280324/test/ELF/Inputs/gc-sections-weak.s (nonexistent) +++ vendor/lld/lld-release_390-r280324/test/ELF/Inputs/gc-sections-weak.s (revision 305296) @@ -0,0 +1,8 @@ +.weak foo +foo: + nop + +.data +.global bar2 +bar2: +.quad foo Property changes on: vendor/lld/lld-release_390-r280324/test/ELF/Inputs/gc-sections-weak.s ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +FreeBSD=%H \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: vendor/lld/lld-release_390-r280324/test/ELF/Inputs/gnu-ifunc-gotpcrel.s =================================================================== --- vendor/lld/lld-release_390-r280324/test/ELF/Inputs/gnu-ifunc-gotpcrel.s (nonexistent) +++ vendor/lld/lld-release_390-r280324/test/ELF/Inputs/gnu-ifunc-gotpcrel.s (revision 305296) @@ -0,0 +1,4 @@ +.type foo STT_GNU_IFUNC +.globl foo +foo: +ret Property changes on: vendor/lld/lld-release_390-r280324/test/ELF/Inputs/gnu-ifunc-gotpcrel.s ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +FreeBSD=%H \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: vendor/lld/lld-release_390-r280324/test/ELF/Inputs/gotpc-relax-und-dso.s =================================================================== --- vendor/lld/lld-release_390-r280324/test/ELF/Inputs/gotpc-relax-und-dso.s (nonexistent) +++ vendor/lld/lld-release_390-r280324/test/ELF/Inputs/gotpc-relax-und-dso.s (revision 305296) @@ -0,0 +1,4 @@ +.globl dsofoo +.type dsofoo, @function +dsofoo: + nop Property changes on: vendor/lld/lld-release_390-r280324/test/ELF/Inputs/gotpc-relax-und-dso.s ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +FreeBSD=%H \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: vendor/lld/lld-release_390-r280324/test/ELF/Inputs/icf2.s =================================================================== --- vendor/lld/lld-release_390-r280324/test/ELF/Inputs/icf2.s (nonexistent) +++ vendor/lld/lld-release_390-r280324/test/ELF/Inputs/icf2.s (revision 305296) @@ -0,0 +1,5 @@ +.globl f1, f2 +.section .text.f2, "ax" +f2: + mov $60, %rdi + call f1 Property changes on: vendor/lld/lld-release_390-r280324/test/ELF/Inputs/icf2.s ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +FreeBSD=%H \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: vendor/lld/lld-release_390-r280324/test/ELF/Inputs/invalid-cie-version2.elf =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/x-object Property changes on: vendor/lld/lld-release_390-r280324/test/ELF/Inputs/invalid-cie-version2.elf ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +application/x-object \ No newline at end of property Index: vendor/lld/lld-release_390-r280324/test/ELF/Inputs/libsearch-dyn.s =================================================================== --- vendor/lld/lld-release_390-r280324/test/ELF/Inputs/libsearch-dyn.s (nonexistent) +++ vendor/lld/lld-release_390-r280324/test/ELF/Inputs/libsearch-dyn.s (revision 305296) @@ -0,0 +1,3 @@ +.globl _bar,_dynamic +_bar: +_dynamic: Property changes on: vendor/lld/lld-release_390-r280324/test/ELF/Inputs/libsearch-dyn.s ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +FreeBSD=%H \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: vendor/lld/lld-release_390-r280324/test/ELF/Inputs/libsearch-st.s =================================================================== --- vendor/lld/lld-release_390-r280324/test/ELF/Inputs/libsearch-st.s (nonexistent) +++ vendor/lld/lld-release_390-r280324/test/ELF/Inputs/libsearch-st.s (revision 305296) @@ -0,0 +1,3 @@ +.globl _bar,_static +_bar: +_static: Property changes on: vendor/lld/lld-release_390-r280324/test/ELF/Inputs/libsearch-st.s ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +FreeBSD=%H \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: vendor/lld/lld-release_390-r280324/test/ELF/Inputs/mips-align-err.s =================================================================== --- vendor/lld/lld-release_390-r280324/test/ELF/Inputs/mips-align-err.s (nonexistent) +++ vendor/lld/lld-release_390-r280324/test/ELF/Inputs/mips-align-err.s (revision 305296) @@ -0,0 +1,2 @@ + .global _foo +_foo: Property changes on: vendor/lld/lld-release_390-r280324/test/ELF/Inputs/mips-align-err.s ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +FreeBSD=%H \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: vendor/lld/lld-release_390-r280324/test/ELF/Inputs/mips-dynamic.s =================================================================== --- vendor/lld/lld-release_390-r280324/test/ELF/Inputs/mips-dynamic.s (nonexistent) +++ vendor/lld/lld-release_390-r280324/test/ELF/Inputs/mips-dynamic.s (revision 305296) @@ -0,0 +1,28 @@ + .option pic2 + .text + .globl _foo +_foo: + nop + + .globl foo0 + .type foo0, @function +foo0: + nop + + .globl foo1 + .type foo1, @function +foo1: + nop + + .data + .globl data0 + .type data0, @object + .size data0, 4 +data0: + .word 0 + + .globl data1 + .type data1, @object + .size data1, 4 +data1: + .word 0 Property changes on: vendor/lld/lld-release_390-r280324/test/ELF/Inputs/mips-dynamic.s ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +FreeBSD=%H \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: vendor/lld/lld-release_390-r280324/test/ELF/Inputs/mips-gp-disp.so =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/x-sharedlib Property changes on: vendor/lld/lld-release_390-r280324/test/ELF/Inputs/mips-gp-disp.so ___________________________________________________________________ Added: epic ## -0,0 +1 ## +fail \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +application/x-sharedlib \ No newline at end of property Index: vendor/lld/lld-release_390-r280324/test/ELF/Inputs/mips-nonalloc.s =================================================================== --- vendor/lld/lld-release_390-r280324/test/ELF/Inputs/mips-nonalloc.s (nonexistent) +++ vendor/lld/lld-release_390-r280324/test/ELF/Inputs/mips-nonalloc.s (revision 305296) @@ -0,0 +1,2 @@ + .section .debug_info + .word __start Property changes on: vendor/lld/lld-release_390-r280324/test/ELF/Inputs/mips-nonalloc.s ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +FreeBSD=%H \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: vendor/lld/lld-release_390-r280324/test/ELF/Inputs/mips-pic.s =================================================================== --- vendor/lld/lld-release_390-r280324/test/ELF/Inputs/mips-pic.s (nonexistent) +++ vendor/lld/lld-release_390-r280324/test/ELF/Inputs/mips-pic.s (revision 305296) @@ -0,0 +1,19 @@ + .option pic2 + + .section .text.1,"ax",@progbits + .align 4 + .globl foo1a + .type foo1a, @function +foo1a: + nop + .globl foo1b + .type foo1b, @function +foo1b: + nop + + .section .text.2,"ax",@progbits + .align 4 + .globl foo2 + .type foo2, @function +foo2: + nop Property changes on: vendor/lld/lld-release_390-r280324/test/ELF/Inputs/mips-pic.s ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +FreeBSD=%H \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: vendor/lld/lld-release_390-r280324/test/ELF/Inputs/mips-tls.s =================================================================== --- vendor/lld/lld-release_390-r280324/test/ELF/Inputs/mips-tls.s (nonexistent) +++ vendor/lld/lld-release_390-r280324/test/ELF/Inputs/mips-tls.s (revision 305296) @@ -0,0 +1,5 @@ + .globl foo + .section .tdata,"awT",%progbits + .type foo, %object +foo: + .word 0 Property changes on: vendor/lld/lld-release_390-r280324/test/ELF/Inputs/mips-tls.s ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +FreeBSD=%H \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: vendor/lld/lld-release_390-r280324/test/ELF/Inputs/plt-aarch64.s =================================================================== --- vendor/lld/lld-release_390-r280324/test/ELF/Inputs/plt-aarch64.s (nonexistent) +++ vendor/lld/lld-release_390-r280324/test/ELF/Inputs/plt-aarch64.s (revision 305296) @@ -0,0 +1,5 @@ +.global bar +bar: + +.global weak +weak: Property changes on: vendor/lld/lld-release_390-r280324/test/ELF/Inputs/plt-aarch64.s ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +FreeBSD=%H \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: vendor/lld/lld-release_390-r280324/test/ELF/Inputs/ppc64-addr16-error.s =================================================================== --- vendor/lld/lld-release_390-r280324/test/ELF/Inputs/ppc64-addr16-error.s (nonexistent) +++ vendor/lld/lld-release_390-r280324/test/ELF/Inputs/ppc64-addr16-error.s (revision 305296) @@ -0,0 +1,3 @@ +.global sym +.hidden sym +sym = 0 Property changes on: vendor/lld/lld-release_390-r280324/test/ELF/Inputs/ppc64-addr16-error.s ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +FreeBSD=%H \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: vendor/lld/lld-release_390-r280324/test/ELF/Inputs/protected-shared.s =================================================================== --- vendor/lld/lld-release_390-r280324/test/ELF/Inputs/protected-shared.s (nonexistent) +++ vendor/lld/lld-release_390-r280324/test/ELF/Inputs/protected-shared.s (revision 305296) @@ -0,0 +1,10 @@ + .global foo + .protected foo +foo: + + .global bar + .protected bar +bar: + + .global zed +zed: Property changes on: vendor/lld/lld-release_390-r280324/test/ELF/Inputs/protected-shared.s ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +FreeBSD=%H \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: vendor/lld/lld-release_390-r280324/test/ELF/Inputs/relocatable-ehframe.s =================================================================== --- vendor/lld/lld-release_390-r280324/test/ELF/Inputs/relocatable-ehframe.s (nonexistent) +++ vendor/lld/lld-release_390-r280324/test/ELF/Inputs/relocatable-ehframe.s (revision 305296) @@ -0,0 +1,14 @@ +.section foo1,"ax",@progbits +.cfi_startproc + nop +.cfi_endproc + +.section bar1,"ax",@progbits +.cfi_startproc + nop +.cfi_endproc + +.section dah1,"ax",@progbits +.cfi_startproc + nop +.cfi_endproc Property changes on: vendor/lld/lld-release_390-r280324/test/ELF/Inputs/relocatable-ehframe.s ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +FreeBSD=%H \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: vendor/lld/lld-release_390-r280324/test/ELF/Inputs/relocatable.s =================================================================== --- vendor/lld/lld-release_390-r280324/test/ELF/Inputs/relocatable.s (nonexistent) +++ vendor/lld/lld-release_390-r280324/test/ELF/Inputs/relocatable.s (revision 305296) @@ -0,0 +1,22 @@ +.text +.type xx,@object +.bss +.globl xx +.align 4 +xx: +.long 0 +.size xx, 4 +.type yy,@object +.globl yy +.align 4 +yy: +.long 0 +.size yy, 4 + +.text +.globl foo +.align 16, 0x90 +.type foo,@function +foo: +movl $1, xx +movl $2, yy Property changes on: vendor/lld/lld-release_390-r280324/test/ELF/Inputs/relocatable.s ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +FreeBSD=%H \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: vendor/lld/lld-release_390-r280324/test/ELF/Inputs/relocatable2.s =================================================================== --- vendor/lld/lld-release_390-r280324/test/ELF/Inputs/relocatable2.s (nonexistent) +++ vendor/lld/lld-release_390-r280324/test/ELF/Inputs/relocatable2.s (revision 305296) @@ -0,0 +1,22 @@ +.text +.type xxx,@object +.bss +.globl xxx +.align 4 +xxx: +.long 0 +.size xxx, 4 +.type yyy,@object +.globl yyy +.align 4 +yyy: +.long 0 +.size yyy, 4 + +.text +.globl bar +.align 16, 0x90 +.type bar,@function +bar: +movl $8, xxx +movl $9, yyy Property changes on: vendor/lld/lld-release_390-r280324/test/ELF/Inputs/relocatable2.s ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +FreeBSD=%H \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: vendor/lld/lld-release_390-r280324/test/ELF/Inputs/relocation-copy-alias.s =================================================================== --- vendor/lld/lld-release_390-r280324/test/ELF/Inputs/relocation-copy-alias.s (nonexistent) +++ vendor/lld/lld-release_390-r280324/test/ELF/Inputs/relocation-copy-alias.s (revision 305296) @@ -0,0 +1,25 @@ +.data + +.globl a1 +.type a1, @object +.size a1, 1 +a1: +.weak a2 +.type a2, @object +.size a2, 1 +a2: +.byte 1 + +.weak b1 +.type b1, @object +.size b1, 1 +b1: +.weak b2 +.type b2, @object +.size b2, 1 +b2: +.globl b3 +.type b3, @object +.size b3, 1 +b3: +.byte 1 Property changes on: vendor/lld/lld-release_390-r280324/test/ELF/Inputs/relocation-copy-alias.s ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +FreeBSD=%H \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: vendor/lld/lld-release_390-r280324/test/ELF/Inputs/relocation-copy-arm.s =================================================================== --- vendor/lld/lld-release_390-r280324/test/ELF/Inputs/relocation-copy-arm.s (nonexistent) +++ vendor/lld/lld-release_390-r280324/test/ELF/Inputs/relocation-copy-arm.s (revision 305296) @@ -0,0 +1,22 @@ +.bss + +.type x,%object +.globl x +.balign 16 +x: +.long 0 +.size x, 4 + +.type y,%object +.globl y +.balign 16 +y: +.long 0 +.size y, 4 + +.type z,%object +.globl z +.balign 4 +z: +.long 0 +.size z, 4 Property changes on: vendor/lld/lld-release_390-r280324/test/ELF/Inputs/relocation-copy-arm.s ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +FreeBSD=%H \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: vendor/lld/lld-release_390-r280324/test/ELF/Inputs/resolution-shared.s =================================================================== --- vendor/lld/lld-release_390-r280324/test/ELF/Inputs/resolution-shared.s (nonexistent) +++ vendor/lld/lld-release_390-r280324/test/ELF/Inputs/resolution-shared.s (revision 305296) @@ -0,0 +1,2 @@ + .global foo +foo: Property changes on: vendor/lld/lld-release_390-r280324/test/ELF/Inputs/resolution-shared.s ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +FreeBSD=%H \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: vendor/lld/lld-release_390-r280324/test/ELF/Inputs/shared.s =================================================================== --- vendor/lld/lld-release_390-r280324/test/ELF/Inputs/shared.s (nonexistent) +++ vendor/lld/lld-release_390-r280324/test/ELF/Inputs/shared.s (revision 305296) @@ -0,0 +1,10 @@ +.global bar +.type bar, @function +bar: + +.global bar2 +.type bar2, @function +bar2: + +.global zed +zed: Property changes on: vendor/lld/lld-release_390-r280324/test/ELF/Inputs/shared.s ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +FreeBSD=%H \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: vendor/lld/lld-release_390-r280324/test/ELF/Inputs/start-lib-comdat.s =================================================================== --- vendor/lld/lld-release_390-r280324/test/ELF/Inputs/start-lib-comdat.s (nonexistent) +++ vendor/lld/lld-release_390-r280324/test/ELF/Inputs/start-lib-comdat.s (revision 305296) @@ -0,0 +1,5 @@ + .global bar +bar: + .section .sec,"aG",@progbits,zed,comdat + .global zed +zed: Property changes on: vendor/lld/lld-release_390-r280324/test/ELF/Inputs/start-lib-comdat.s ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +FreeBSD=%H \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: vendor/lld/lld-release_390-r280324/test/ELF/Inputs/start-lib1.s =================================================================== --- vendor/lld/lld-release_390-r280324/test/ELF/Inputs/start-lib1.s (nonexistent) +++ vendor/lld/lld-release_390-r280324/test/ELF/Inputs/start-lib1.s (revision 305296) @@ -0,0 +1,3 @@ +.globl foo +foo: + call bar Property changes on: vendor/lld/lld-release_390-r280324/test/ELF/Inputs/start-lib1.s ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +FreeBSD=%H \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: vendor/lld/lld-release_390-r280324/test/ELF/Inputs/start-lib2.s =================================================================== --- vendor/lld/lld-release_390-r280324/test/ELF/Inputs/start-lib2.s (nonexistent) +++ vendor/lld/lld-release_390-r280324/test/ELF/Inputs/start-lib2.s (revision 305296) @@ -0,0 +1,2 @@ +.globl bar +bar: Property changes on: vendor/lld/lld-release_390-r280324/test/ELF/Inputs/start-lib2.s ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +FreeBSD=%H \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: vendor/lld/lld-release_390-r280324/test/ELF/Inputs/symbol-override.s =================================================================== --- vendor/lld/lld-release_390-r280324/test/ELF/Inputs/symbol-override.s (nonexistent) +++ vendor/lld/lld-release_390-r280324/test/ELF/Inputs/symbol-override.s (revision 305296) @@ -0,0 +1,16 @@ +.text +.globl foo +.type foo,@function +foo: +nop + +.globl bar +.type bar,@function +bar: +nop + +.globl do +.type do,@function +do: +callq foo@PLT +callq bar@PLT Property changes on: vendor/lld/lld-release_390-r280324/test/ELF/Inputs/symbol-override.s ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +FreeBSD=%H \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: vendor/lld/lld-release_390-r280324/test/ELF/Inputs/tls-got-entry.s =================================================================== --- vendor/lld/lld-release_390-r280324/test/ELF/Inputs/tls-got-entry.s (nonexistent) +++ vendor/lld/lld-release_390-r280324/test/ELF/Inputs/tls-got-entry.s (revision 305296) @@ -0,0 +1,13 @@ +.globl __tls_get_addr +.align 16, 0x90 +.type __tls_get_addr,@function +__tls_get_addr: + +.type tlsshared0,@object +.section .tbss,"awT",@nobits +.globl tlsshared0 +.align 4 +tlsshared0: + .long 0 + .size tlsshared0, 4 + Property changes on: vendor/lld/lld-release_390-r280324/test/ELF/Inputs/tls-got-entry.s ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +FreeBSD=%H \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: vendor/lld/lld-release_390-r280324/test/ELF/Inputs/tls-in-archive.s =================================================================== --- vendor/lld/lld-release_390-r280324/test/ELF/Inputs/tls-in-archive.s (nonexistent) +++ vendor/lld/lld-release_390-r280324/test/ELF/Inputs/tls-in-archive.s (revision 305296) @@ -0,0 +1,3 @@ + .type foo, @tls_object + .globl foo +foo: Property changes on: vendor/lld/lld-release_390-r280324/test/ELF/Inputs/tls-in-archive.s ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +FreeBSD=%H \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: vendor/lld/lld-release_390-r280324/test/ELF/Inputs/trace-ar1.s =================================================================== --- vendor/lld/lld-release_390-r280324/test/ELF/Inputs/trace-ar1.s (nonexistent) +++ vendor/lld/lld-release_390-r280324/test/ELF/Inputs/trace-ar1.s (revision 305296) @@ -0,0 +1,2 @@ +.globl _used +_used: Property changes on: vendor/lld/lld-release_390-r280324/test/ELF/Inputs/trace-ar1.s ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +FreeBSD=%H \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: vendor/lld/lld-release_390-r280324/test/ELF/Inputs/trace-ar2.s =================================================================== --- vendor/lld/lld-release_390-r280324/test/ELF/Inputs/trace-ar2.s (nonexistent) +++ vendor/lld/lld-release_390-r280324/test/ELF/Inputs/trace-ar2.s (revision 305296) @@ -0,0 +1,2 @@ +.globl _notused +_notused: Property changes on: vendor/lld/lld-release_390-r280324/test/ELF/Inputs/trace-ar2.s ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +FreeBSD=%H \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: vendor/lld/lld-release_390-r280324/test/ELF/Inputs/trace-symbols-foo-strong.s =================================================================== --- vendor/lld/lld-release_390-r280324/test/ELF/Inputs/trace-symbols-foo-strong.s (nonexistent) +++ vendor/lld/lld-release_390-r280324/test/ELF/Inputs/trace-symbols-foo-strong.s (revision 305296) @@ -0,0 +1,14 @@ +.text +.globl foo +.type foo, @function +foo: +nop + +.globl bar +.type bar, @function +bar: +nop + +.global func2 +.type func2, @function +func2: Property changes on: vendor/lld/lld-release_390-r280324/test/ELF/Inputs/trace-symbols-foo-strong.s ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +FreeBSD=%H \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: vendor/lld/lld-release_390-r280324/test/ELF/Inputs/trace-symbols-foo-weak.s =================================================================== --- vendor/lld/lld-release_390-r280324/test/ELF/Inputs/trace-symbols-foo-weak.s (nonexistent) +++ vendor/lld/lld-release_390-r280324/test/ELF/Inputs/trace-symbols-foo-weak.s (revision 305296) @@ -0,0 +1,12 @@ +.comm common,4,4 +.text +.weak foo +.type foo, @function +foo: +callq bar@PLT + +.globl func1 +.type func1, @function +func1: +call func2@PLT + Property changes on: vendor/lld/lld-release_390-r280324/test/ELF/Inputs/trace-symbols-foo-weak.s ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +FreeBSD=%H \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: vendor/lld/lld-release_390-r280324/test/ELF/Inputs/undef-with-plt-addr.s =================================================================== --- vendor/lld/lld-release_390-r280324/test/ELF/Inputs/undef-with-plt-addr.s (nonexistent) +++ vendor/lld/lld-release_390-r280324/test/ELF/Inputs/undef-with-plt-addr.s (revision 305296) @@ -0,0 +1,7 @@ + .globl set_data + .type set_data,@function +set_data: + + .globl foo + .type foo,@function +foo: Property changes on: vendor/lld/lld-release_390-r280324/test/ELF/Inputs/undef-with-plt-addr.s ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +FreeBSD=%H \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: vendor/lld/lld-release_390-r280324/test/ELF/Inputs/undef.s =================================================================== --- vendor/lld/lld-release_390-r280324/test/ELF/Inputs/undef.s (nonexistent) +++ vendor/lld/lld-release_390-r280324/test/ELF/Inputs/undef.s (revision 305296) @@ -0,0 +1,3 @@ + .global zed1 +zed1: + .quad zed2 Property changes on: vendor/lld/lld-release_390-r280324/test/ELF/Inputs/undef.s ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +FreeBSD=%H \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: vendor/lld/lld-release_390-r280324/test/ELF/Inputs/unresolved-symbols.s =================================================================== --- vendor/lld/lld-release_390-r280324/test/ELF/Inputs/unresolved-symbols.s (nonexistent) +++ vendor/lld/lld-release_390-r280324/test/ELF/Inputs/unresolved-symbols.s (revision 305296) @@ -0,0 +1,3 @@ +.globl _shared +_shared: + callq undef@PLT Property changes on: vendor/lld/lld-release_390-r280324/test/ELF/Inputs/unresolved-symbols.s ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +FreeBSD=%H \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: vendor/lld/lld-release_390-r280324/test/ELF/Inputs/verdef-defaultver.s =================================================================== --- vendor/lld/lld-release_390-r280324/test/ELF/Inputs/verdef-defaultver.s (nonexistent) +++ vendor/lld/lld-release_390-r280324/test/ELF/Inputs/verdef-defaultver.s (revision 305296) @@ -0,0 +1,22 @@ +b@LIBSAMPLE_1.0 = b_1 +b@@LIBSAMPLE_2.0 = b_2 + +.globl a +.type a,@function +a: +retq + +.globl b_1 +.type b_1,@function +b_1: +retq + +.globl b_2 +.type b_2,@function +b_2: +retq + +.globl c +.type c,@function +c: +retq Property changes on: vendor/lld/lld-release_390-r280324/test/ELF/Inputs/verdef-defaultver.s ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +FreeBSD=%H \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: vendor/lld/lld-release_390-r280324/test/ELF/Inputs/verdef.s =================================================================== --- vendor/lld/lld-release_390-r280324/test/ELF/Inputs/verdef.s (nonexistent) +++ vendor/lld/lld-release_390-r280324/test/ELF/Inputs/verdef.s (revision 305296) @@ -0,0 +1,6 @@ +.text +.globl _start +_start: + callq a + callq b + callq c Property changes on: vendor/lld/lld-release_390-r280324/test/ELF/Inputs/verdef.s ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +FreeBSD=%H \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: vendor/lld/lld-release_390-r280324/test/ELF/Inputs/verneed.so.sh =================================================================== --- vendor/lld/lld-release_390-r280324/test/ELF/Inputs/verneed.so.sh (nonexistent) +++ vendor/lld/lld-release_390-r280324/test/ELF/Inputs/verneed.so.sh (revision 305296) @@ -0,0 +1,58 @@ +#!/bin/sh -eu + +# This script was used to produce the verneed{1,2}.so files. + +tmp=$(mktemp -d) + +echo "v1 {}; v2 {}; v3 {}; { local: *; };" > $tmp/verneed.script + +cat > $tmp/verneed1.s < $tmp/verneed2.s <