This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: Binutils: Build regression after recent PPC gold updates
- From: Alan Modra <amodra at gmail dot com>
- To: Jan-Benedict Glaw <jbglaw at lug-owl dot de>
- Cc: binutils at sourceware dot org
- Date: Tue, 14 Aug 2012 11:50:11 +0930
- Subject: Re: Binutils: Build regression after recent PPC gold updates
- References: <20120813184024.GE11564@lug-owl.de>
On Mon, Aug 13, 2012 at 08:40:24PM +0200, Jan-Benedict Glaw wrote:
> .../powerpc.cc:818:5: note: use âthis->replace_constantâ instead
> g++ (Debian 4.7.1-3) 4.7.1
Thanks for the report. It's fine with 4.8.0 20120801 (experimental)..
> Oh, and the email address that shows up in the binutils GIT tree (Alan
> Modra <amodra@bigpond.net.au>) doesn't work:
I don't know how to fix this.
elfcpp/
* powerpc.h: Add more relocs.
(R_PPC_REL16*): Rename to R_POWERPC_REL16*.
gold/
* powerpc.cc: Update for renamed R_PPC_REL16 relocs.
(Output_data_got_powerpc::do_write): Don't rely on base class lookup
for replace_constant call.
(Output_data_plt_powerpc::do_print_to_mapfile): New function.
(Output_data_glink::do_print_to_mapfile): New function.
(Target_powerpc::Scan::local): Ignore R_PPC64_TOCSAVE.
(Target_powerpc::Relocate::relocate): Likewise.
Index: elfcpp/powerpc.h
===================================================================
RCS file: /cvs/src/src/elfcpp/powerpc.h,v
retrieving revision 1.2
diff -u -p -r1.2 powerpc.h
--- elfcpp/powerpc.h 4 Aug 2010 09:53:38 -0000 1.2
+++ elfcpp/powerpc.h 14 Aug 2012 01:13:38 -0000
@@ -137,27 +137,32 @@ enum
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,
@@ -166,11 +171,30 @@ enum
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,
Index: gold/powerpc.cc
===================================================================
RCS file: /cvs/src/src/gold/powerpc.cc,v
retrieving revision 1.47
diff -u -p -r1.47 powerpc.cc
--- gold/powerpc.cc 14 Aug 2012 01:07:01 -0000 1.47
+++ gold/powerpc.cc 14 Aug 2012 01:11:04 -0000
@@ -654,7 +667,7 @@ public:
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,
@@ -662,7 +675,7 @@ public:
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,
@@ -670,7 +683,7 @@ public:
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,
@@ -680,7 +693,7 @@ public:
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
@@ -806,10 +819,10 @@ public:
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);
}
@@ -944,6 +957,11 @@ class Output_data_plt_powerpc : public O
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;
@@ -1131,6 +1149,12 @@ class Output_data_glink : public Output_
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;
@@ -1661,10 +1685,10 @@ Target_powerpc<size, big_endian>::Scan::
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:
@@ -1823,6 +1847,7 @@ Target_powerpc<size, big_endian>::Scan::
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:
@@ -1859,8 +1884,8 @@ Target_powerpc<size, big_endian>::Scan::
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:
@@ -2050,10 +2075,10 @@ Target_powerpc<size, big_endian>::Scan::
}
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:
@@ -2400,15 +2425,15 @@ Target_powerpc<size, big_endian>::Reloca
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;
@@ -2435,6 +2460,10 @@ Target_powerpc<size, big_endian>::Reloca
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"),
--
Alan Modra
Australia Development Lab, IBM