From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26338 invoked by alias); 14 Aug 2012 02:20:46 -0000 Received: (qmail 26325 invoked by uid 22791); 14 Aug 2012 02:20:44 -0000 X-SWARE-Spam-Status: No, hits=-3.8 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,KHOP_RCVD_TRUST,RCVD_IN_DNSWL_LOW,RCVD_IN_HOSTKARMA_YE,TW_XF X-Spam-Check-By: sourceware.org Received: from mail-gh0-f169.google.com (HELO mail-gh0-f169.google.com) (209.85.160.169) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 14 Aug 2012 02:20:18 +0000 Received: by ghrr18 with SMTP id r18so4151450ghr.0 for ; Mon, 13 Aug 2012 19:20:18 -0700 (PDT) Received: by 10.50.213.39 with SMTP id np7mr8710218igc.51.1344910817579; Mon, 13 Aug 2012 19:20:17 -0700 (PDT) Received: from bubble.grove.modra.org ([101.166.26.37]) by mx.google.com with ESMTPS id ut5sm17996393igc.13.2012.08.13.19.20.15 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 13 Aug 2012 19:20:16 -0700 (PDT) Received: by bubble.grove.modra.org (Postfix, from userid 1000) id 201F5EA0383; Tue, 14 Aug 2012 11:50:11 +0930 (CST) Date: Tue, 14 Aug 2012 02:33:00 -0000 From: Alan Modra To: Jan-Benedict Glaw Cc: binutils@sourceware.org Subject: Re: Binutils: Build regression after recent PPC gold updates Message-ID: <20120814022010.GF3947@bubble.grove.modra.org> Mail-Followup-To: Jan-Benedict Glaw , binutils@sourceware.org References: <20120813184024.GE11564@lug-owl.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20120813184024.GE11564@lug-owl.de> User-Agent: Mutt/1.5.21 (2010-09-15) X-IsSubscribed: yes Mailing-List: contact binutils-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: binutils-owner@sourceware.org X-SW-Source: 2012-08/txt/msg00243.txt.bz2 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 ) 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::Elf_Addr value, @@ -662,7 +675,7 @@ public: typename elfcpp::Elf_types::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::Elf_Addr value, @@ -670,7 +683,7 @@ public: typename elfcpp::Elf_types::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::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::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::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::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::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::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::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::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