// powerpc.h -- ELF definitions specific to EM_PPC and EM_PPC64 -*- C++ -*-
-// Copyright 2008, 2010 Free Software Foundation, Inc.
+// Copyright 2008, 2010, 2012 Free Software Foundation, Inc.
// Written by David S. Miller <davem@davemloft.net>.
// This file is part of elfcpp.
R_POWERPC_GOT_DTPREL16_LO = 92,
R_POWERPC_GOT_DTPREL16_HI = 93,
R_POWERPC_GOT_DTPREL16_HA = 94,
+ R_PPC_TLSGD = 95,
R_PPC64_TPREL16_DS = 95,
+ R_PPC_TLSLD = 96,
R_PPC64_TPREL16_LO_DS = 96,
R_PPC64_TPREL16_HIGHER = 97,
R_PPC64_TPREL16_HIGHERA = 98,
R_PPC64_TPREL16_HIGHEST = 99,
R_PPC64_TPREL16_HIGHESTA = 100,
- R_PPC64_DTPREL16_DS = 101,
- R_PPC64_DTPREL16_LO_DS = 102,
- R_PPC64_DTPREL16_HIGHER = 103,
- R_PPC64_DTPREL16_HIGHERA = 104,
- R_PPC64_DTPREL16_HIGHEST = 105,
- R_PPC64_DTPREL16_HIGHESTA = 106,
R_PPC_EMB_NADDR32 = 101,
+ R_PPC64_DTPREL16_DS = 101,
R_PPC_EMB_NADDR16 = 102,
+ R_PPC64_DTPREL16_LO_DS = 102,
R_PPC_EMB_NADDR16_LO = 103,
+ R_PPC64_DTPREL16_HIGHER = 103,
R_PPC_EMB_NADDR16_HI = 104,
+ R_PPC64_DTPREL16_HIGHERA = 104,
R_PPC_EMB_NADDR16_HA = 105,
+ R_PPC64_DTPREL16_HIGHEST = 105,
R_PPC_EMB_SDAI16 = 106,
+ R_PPC64_DTPREL16_HIGHESTA = 106,
R_PPC_EMB_SDA2I16 = 107,
+ R_PPC64_TLSGD = 107,
R_PPC_EMB_SDA2REL = 108,
+ R_PPC64_TLSLD = 108,
R_PPC_EMB_SDA21 = 109,
+ R_PPC64_TOCSAVE = 109,
R_PPC_EMB_MRKREF = 110,
R_PPC_EMB_RELSEC16 = 111,
R_PPC_EMB_RELST_LO = 112,
R_PPC_EMB_BIT_FLD = 115,
R_PPC_EMB_RELSDA = 116,
+ R_PPC_VLE_REL8 = 216,
+ R_PPC_VLE_REL15 = 217,
+ R_PPC_VLE_REL24 = 218,
+ R_PPC_VLE_LO16A = 219,
+ R_PPC_VLE_LO16D = 220,
+ R_PPC_VLE_HI16A = 221,
+ R_PPC_VLE_HI16D = 222,
+ R_PPC_VLE_HA16A = 223,
+ R_PPC_VLE_HA16D = 224,
+ R_PPC_VLE_SDA21 = 225,
+ R_PPC_VLE_SDA21_LO = 226,
+ R_PPC_VLE_SDAREL_LO16A = 227,
+ R_PPC_VLE_SDAREL_LO16D = 228,
+ R_PPC_VLE_SDAREL_HI16A = 229,
+ R_PPC_VLE_SDAREL_HI16D = 230,
+ R_PPC_VLE_SDAREL_HA16A = 231,
+ R_PPC_VLE_SDAREL_HA16D = 232,
+
+ R_PPC64_JMP_IREL = 247,
R_POWERPC_IRELATIVE = 248,
- R_PPC_REL16 = 249,
- R_PPC_REL16_LO = 250,
- R_PPC_REL16_HI = 251,
- R_PPC_REL16_HA = 252,
+ R_POWERPC_REL16 = 249,
+ R_POWERPC_REL16_LO = 250,
+ R_POWERPC_REL16_HI = 251,
+ R_POWERPC_REL16_HA = 252,
R_POWERPC_GNU_VTINHERIT = 253,
R_POWERPC_GNU_VTENTRY = 254,
R_PPC_TOC16 = 255,
This::addr16_hi(view, value + 0x8000, addend);
}
- // R_PPC_REL16: (Symbol + Addend - Address) & 0xffff
+ // R_POWERPC_REL16: (Symbol + Addend - Address) & 0xffff
static inline void
rel16(unsigned char* view,
typename elfcpp::Elf_types<size>::Elf_Addr value,
typename elfcpp::Elf_types<size>::Elf_Addr address)
{ This_reloc::pcrela16(view, value, addend, address); }
- // R_PPC_REL16_LO: (Symbol + Addend - Address) & 0xffff
+ // R_POWERPC_REL16_LO: (Symbol + Addend - Address) & 0xffff
static inline void
rel16_lo(unsigned char* view,
typename elfcpp::Elf_types<size>::Elf_Addr value,
typename elfcpp::Elf_types<size>::Elf_Addr address)
{ This_reloc::pcrela16(view, value, addend, address); }
- // R_PPC_REL16_HI: ((Symbol + Addend - Address) >> 16) & 0xffff
+ // R_POWERPC_REL16_HI: ((Symbol + Addend - Address) >> 16) & 0xffff
static inline void
rel16_hi(unsigned char* view,
typename elfcpp::Elf_types<size>::Elf_Addr value,
This::template rela<16>(view, 16, 0xffff, value - address, addend);
}
- // R_PPC_REL16_HA: Same as R_PPC_REL16_HI except that if the
+ // R_POWERPC_REL16_HA: Same as R_POWERPC_REL16_HI except that if the
// final value of the low 16 bits of the
// relocation is negative, add one.
static inline void
void
do_write(Output_file* of)
{
- replace_constant(this->header_index_,
- (size == 32
- ? this->layout_->dynamic_section()->address()
- : this->address() + 0x8000));
+ this->replace_constant(this->header_index_,
+ (size == 32
+ ? this->layout_->dynamic_section()->address()
+ : this->address() + 0x8000));
Output_data_got<size, big_endian>::do_write(of);
}
os->set_entsize(0);
}
+ // Write to a map file.
+ void
+ do_print_to_mapfile(Mapfile* mapfile) const
+ { mapfile->print_output_data(this, _("** PLT")); }
+
private:
// The size of an entry in the PLT.
static const int plt_entry_size = size == 32 ? 4 : 24;
return this->pltresolve_;
}
+ protected:
+ // Write to a map file.
+ void
+ do_print_to_mapfile(Mapfile* mapfile) const
+ { mapfile->print_output_data(this, _("** glink")); }
+
private:
static const int pltresolve_size = 16*4;
case elfcpp::R_POWERPC_REL24:
case elfcpp::R_PPC_LOCAL24PC:
- case elfcpp::R_PPC_REL16:
- case elfcpp::R_PPC_REL16_LO:
- case elfcpp::R_PPC_REL16_HI:
- case elfcpp::R_PPC_REL16_HA:
+ case elfcpp::R_POWERPC_REL16:
+ case elfcpp::R_POWERPC_REL16_LO:
+ case elfcpp::R_POWERPC_REL16_HI:
+ case elfcpp::R_POWERPC_REL16_HA:
return Symbol::RELATIVE_REF;
case elfcpp::R_PPC_PLTREL24:
case elfcpp::R_POWERPC_NONE:
case elfcpp::R_POWERPC_GNU_VTINHERIT:
case elfcpp::R_POWERPC_GNU_VTENTRY:
+ case elfcpp::R_PPC64_TOCSAVE:
break;
case elfcpp::R_PPC64_ADDR64:
case elfcpp::R_POWERPC_REL24:
case elfcpp::R_PPC_LOCAL24PC:
case elfcpp::R_POWERPC_REL32:
- case elfcpp::R_PPC_REL16_LO:
- case elfcpp::R_PPC_REL16_HA:
+ case elfcpp::R_POWERPC_REL16_LO:
+ case elfcpp::R_POWERPC_REL16_HA:
break;
case elfcpp::R_POWERPC_GOT16:
}
break;
- case elfcpp::R_PPC_REL16:
- case elfcpp::R_PPC_REL16_LO:
- case elfcpp::R_PPC_REL16_HI:
- case elfcpp::R_PPC_REL16_HA:
+ case elfcpp::R_POWERPC_REL16:
+ case elfcpp::R_POWERPC_REL16_LO:
+ case elfcpp::R_POWERPC_REL16_HI:
+ case elfcpp::R_POWERPC_REL16_HA:
break;
case elfcpp::R_POWERPC_GOT16:
Reloc::addr16_ha(view, value, 0);
break;
- case elfcpp::R_PPC_REL16_LO:
+ case elfcpp::R_POWERPC_REL16_LO:
Reloc::rel16_lo(view, value, 0, address);
break;
- case elfcpp::R_PPC_REL16_HI:
+ case elfcpp::R_POWERPC_REL16_HI:
Reloc::rel16_hi(view, value, 0, address);
break;
- case elfcpp::R_PPC_REL16_HA:
+ case elfcpp::R_POWERPC_REL16_HA:
Reloc::rel16_ha(view, value, 0, address);
break;
r_type);
break;
+ case elfcpp::R_PPC64_TOCSAVE:
+ // For the time being this can be ignored.
+ break;
+
default:
gold_error_at_location(relinfo, relnum, rela.get_r_offset(),
_("unsupported reloc %u"),