Update binutils to 2.25.1

This commit is contained in:
Wolfgang Thaller
2015-08-28 17:32:19 +02:00
parent 2ce044c327
commit da4dfe30c9
4422 changed files with 490780 additions and 151428 deletions
+81 -5
View File
@@ -1,18 +1,94 @@
2014-09-17 Han Shen <shenhan@google.com>
* aarch64.h (R_AARCH64_TLS_DTPREL64): Switch enum value with ...
(R_AARCH64_TLS_DTPMOD64): ... enum value.
2014-09-15 Andrew Bennett <andrew.bennett@imgtec.com>
Matthew Fortune <matthew.fortune@imgtec.com>
* mips.h (E_MIPS_ARCH_32R6, E_MIPS_ARCH_64R6): New enum constants.
2014-09-02 Cary Coutant <ccoutant@google.com>
* elfcpp_file.h (Elf_file::shnum): New const function.
(Elf_file::shstrndx): New const function.
(Elf_file::large_shndx_offset): New const function.
(Elf_file::section_name): Add const attribute.
(Elf_file::section_header_offset): Likewise.
2014-08-08 Han Shen <shenhan@google.com>
* aarch64.h (withdrawn): Replaced with R_AARCH64_withdrawn.
2014-07-29 Matthew Fortune <matthew.fortune@imgtec.com>
* elfcpp.h (PT_MIPS_ABIFLAGS): New program header type.
2014-07-02 Jing Yu <jingyu@google.com>
* aarch64.h: New file. New enums for aarch64-elf64 relocations.
* elfcpp.h (EM_AARCH64, SHT_AARCH64_ATTRIBUTES, PT_AARCH64_ARCHEXT,
PT_AARCH64_UNWIND): New enum constant.
2014-04-22 Christian Svensson <blue@cmd.nu>
* elfcpp.h: Remove openrisc and or32 support.
2014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
* mips.h (R _MIPS16_TLS_GD, R_MIPS16_TLS_LDM, R_MIPS16_TLS_DTPREL_HI16,
R_MIPS16_TLS_DTPREL_LO16, R_MIPS16_TLS_GOTTPREL,
R_MIPS16_TLS_TPREL_HI16, R_MIPS16_TLS_TPREL_LO16, R_MICROMIPS_26_S1,
R_MICROMIPS_HI16, R_MICROMIPS_LO16, R_MICROMIPS_GPREL16,
R_MICROMIPS_LITERAL, R_MICROMIPS_GOT16, R_MICROMIPS_PC7_S1,
R_MICROMIPS_PC10_S1, R_MICROMIPS_PC16_S1, R_MICROMIPS_CALL16,
R_MICROMIPS_GOT_DISP, R_MICROMIPS_GOT_PAGE, R_MICROMIPS_GOT_OFST,
R_MICROMIPS_GOT_HI16, R_MICROMIPS_GOT_LO16, R_MICROMIPS_SUB,
R_MICROMIPS_HIGHER, R_MICROMIPS_HIGHEST, R_MICROMIPS_CALL_HI16,
R_MICROMIPS_CALL_LO16, R_MICROMIPS_SCN_DISP, R_MICROMIPS_JALR,
R_MICROMIPS_HI0_LO16, R_MICROMIPS_TLS_GD, R_MICROMIPS_TLS_LDM,
R_MICROMIPS_TLS_DTPREL_HI16, R_MICROMIPS_TLS_DTPREL_LO16,
R_MICROMIPS_TLS_GOTTPREL, R_MICROMIPS_TLS_TPREL_HI16,
R_MICROMIPS_TLS_TPREL_LO16, R_MICROMIPS_GPREL7_S2,
R_MICROMIPS_PC23_S20, R_MIPS_EH): New enums for relocations (mips16 and
micromips).
(STO_MIPS_FLAGS): New enum constant.
(elf_st_is_mips16): New function.
(elf_st_is_micromips): New function.
(is_micromips): New function.
(abi_n32): New function.
(abi_n64): New function.
(ODK_NULL, ODK_REGINFO, ODK_EXCEPTIONS, ODK_PAD, ODK_HWPATCH, ODK_FILL,
ODK_TAGS, ODK_HWAND, ODK_HWOR, ODK_GP_GROUP, ODK_IDENT): New enum
constants.
* elfcpp.h (SHT_MIPS_OPTIONS): New enum constant.
2014-03-05 Alan Modra <amodra@gmail.com>
Update copyright years.
2014-03-05 Alan Modra <amodra@gmail.com>
* powerpc.h (R_PPC64_REL24_NOTOC, R_PPC64_ADDR64_LOCAL): Define.
2014-02-06 Andrew Pinski <apinski@cavium.com>
* mips.h (E_MIPS_MACH_OCTEON3): New enum constant.
2013-11-17 H.J. Lu <hongjiu.lu@intel.com>
* x86_64.h (R_X86_64_PC32_BND): New.
(R_X86_64_PLT32_BND): Likewise.
2013-11-15 Alan Modra <amodra@gmail.com>
2013-10-30 Alan Modra <amodra@gmail.com>
Apply mainline changes to 2.24
2013-10-30 Alan Modra <amodra@gmail.com>
* powerpc.h (EF_PPC64_ABI): New enum constant.
(STO_PPC64_LOCAL_BIT, STO_PPC64_LOCAL_MASK): Likewise.
(ppc64_decode_local_entry): New function.
(ppc64_encode_local_entry): Likewise.
2013-10-30 Alan Modra <amodra@gmail.com>
2013-10-30 Alan Modra <amodra@gmail.com>
* powerpc.h (R_PPC64_ADDR16_HIGH, R_PPC64_ADDR16_HIGHA,
R_PPC64_TPREL16_HIGH, R_PPC64_TPREL16_HIGHA,
R_PPC64_DTPREL16_HIGH, R_PPC64_DTPREL16_HIGHA): Define.
@@ -305,7 +381,7 @@
* Added source code to GNU binutils.
Copyright (C) 2008-2012 Free Software Foundation, Inc.
Copyright (C) 2008-2014 Free Software Foundation, Inc.
Copying and distribution of this file, with or without modification,
are permitted in any medium without royalty provided the copyright
+1 -1
View File
@@ -9,7 +9,7 @@ For efficiency, most accessors are templates with two arguments: the
ELF file class (32 or 64 bits) and the endianness.
Copyright (C) 2012 Free Software Foundation, Inc.
Copyright (C) 2012-2014 Free Software Foundation, Inc.
Copying and distribution of this file, with or without modification,
are permitted in any medium without royalty provided the copyright
+187
View File
@@ -0,0 +1,187 @@
// aarch64.h -- ELF definitions specific to AARCH64 -*- C++ -*-
// Copyright (C) 2014 Free Software Foundation, Inc.
// Written by Jing Yu (jingyu@google.com)
// This file is part of elfcpp.
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU Library General Public License
// as published by the Free Software Foundation; either version 2, or
// (at your option) any later version.
// In addition to the permissions in the GNU Library General Public
// License, the Free Software Foundation gives you unlimited
// permission to link the compiled version of this file into
// combinations with other programs, and to distribute those
// combinations without any restriction coming from the use of this
// file. (The Library Public License restrictions do apply in other
// respects; for example, they cover modification of the file, and
/// distribution when not linked into a combined executable.)
// This program is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Library General Public License for more details.
// You should have received a copy of the GNU Library General Public
// License along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
// 02110-1301, USA.
#ifndef ELFCPP_AARCH64_H
#define ELFCPP_AARCH64_H
namespace elfcpp
{
// The relocation type information is taken from:
//
// ELF for the ARM 64-bit Architecture (AArch64)
// Document number: ARM IHI 0056B, current through AArch64 ABI release 1.0
// Date of Issue: 22nd May, 2013
//
enum
{
// Null relocation codes
R_AARCH64_NONE = 0, // None
R_AARCH64_withdrawn = 256, // Treat as R_AARCH64_NONE
// Static relocations
R_AARCH64_ABS64 = 257, // S + A
R_AARCH64_ABS32 = 258, // S + A
R_AARCH64_ABS16 = 259, // S + A
R_AARCH64_PREL64 = 260, // S + A - P
R_AARCH64_PREL32 = 261, // S + A - P
R_AARCH64_PREL16 = 262, // S + A - P
R_AARCH64_MOVW_UABS_G0 = 263, // S + A
R_AARCH64_MOVW_UABS_G0_NC = 264, // S + A
R_AARCH64_MOVW_UABS_G1 = 265, // S + A
R_AARCH64_MOVW_UABS_G1_NC = 266, // S + A
R_AARCH64_MOVW_UABS_G2 = 267, // S + A
R_AARCH64_MOVW_UABS_G2_NC = 268, // S + A
R_AARCH64_MOVW_UABS_G3 = 269, // S + A
R_AARCH64_MOVW_SABS_G0 = 270, // S + A
R_AARCH64_MOVW_SABS_G1 = 271, // S + A
R_AARCH64_MOVW_SABS_G2 = 272, // S + A
R_AARCH64_LD_PREL_LO19 = 273, // S + A - P
R_AARCH64_ADR_PREL_LO21 = 274, // S + A - P
R_AARCH64_ADR_PREL_PG_HI21 = 275, // Page(S+A) - Page(P)
R_AARCH64_ADR_PREL_PG_HI21_NC = 276, // Page(S+A) - Page(P)
R_AARCH64_ADD_ABS_LO12_NC = 277, // S + A
R_AARCH64_LDST8_ABS_LO12_NC = 278, // S + A
R_AARCH64_TSTBR14 = 279, // S + A - P
R_AARCH64_CONDBR19 = 280, // S + A - P
R_AARCH64_JUMP26 = 282, // S + A - P
R_AARCH64_CALL26 = 283, // S + A - P
R_AARCH64_LDST16_ABS_LO12_NC = 284, // S + A
R_AARCH64_LDST32_ABS_LO12_NC = 285, // S + A
R_AARCH64_LDST64_ABS_LO12_NC = 286, // S + A
R_AARCH64_MOVW_PREL_G0 = 287, // S + A - P
R_AARCH64_MOVW_PREL_G0_NC = 288, // S + A - P
R_AARCH64_MOVW_PREL_G1 = 289, // S + A - P
R_AARCH64_MOVW_PREL_G1_NC = 290, // S + A - P
R_AARCH64_MOVW_PREL_G2 = 291, // S + A - P
R_AARCH64_MOVW_PREL_G2_NC = 292, // S + A - P
R_AARCH64_MOVW_PREL_G3 = 293, // S + A - P
R_AARCH64_LDST128_ABS_LO12_NC = 299, // S + A
R_AARCH64_MOVW_GOTOFF_G0 = 300, // G(GDAT(S+A))-GOT
R_AARCH64_MOVW_GOTOFF_G0_NC = 301, // G(GDAT(S+A))-GOT
R_AARCH64_MOVW_GOTOFF_G1 = 302, // G(GDAT(S+A))-GOT
R_AARCH64_MOVW_GOTOFF_G1_NC = 303, // G(GDAT(S+A))-GOT
R_AARCH64_MOVW_GOTOFF_G2 = 304, // G(GDAT(S+A))-GOT
R_AARCH64_MOVW_GOTOFF_G2_NC = 305, // G(GDAT(S+A))-GOT
R_AARCH64_MOVW_GOTOFF_G3 = 306, // G(GDAT(S+A))-GOT
R_AARCH64_GOTREL64 = 307, // S + A - GOT
R_AARCH64_GOTREL32 = 308, // S + A - GOT
R_AARCH64_GOT_LD_PREL19 = 309, // G(GDAT(S+A))-P
R_AARCH64_LD64_GOTOFF_LO15 = 310, // G(GDAT(S+A))-GOT
R_AARCH64_ADR_GOT_PAGE = 311, // Page(G(GDAT(S+A)))-Page(P)
R_AARCH64_LD64_GOT_LO12_NC = 312, // G(GDAT(S+A))
R_AARCH64_LD64_GOTPAGE_LO15 = 313, // G(GDAT(S+A))-Page(GOT)
// Relocations for thread-local storage
R_AARCH64_TLSGD_ADR_PREL21 = 512, // G(GTLSIDX(S,A)) - P
R_AARCH64_TLSGD_ADR_PAGE21 = 513, // Page(G(GTLSIDX(S,A)))-Page(P)
R_AARCH64_TLSGD_ADD_LO12_NC = 514, // G(GTLSICX(S,A))
R_AARCH64_TLSGD_MOVW_G1 = 515, // G(GTLSIDX(S,A)) - GOT
R_AARCH64_TLSGD_MOVW_G0_NC = 516, // G(GTLSIDX(S,A)) - GOT
R_AARCH64_TLSLD_ADR_PREL21 = 517, // G(GLDM(S)) - P
R_AARCH64_TLSLD_ADR_PAGE21 = 518, // Page(G(GLDM(S))) - Page(P)
R_AARCH64_TLSLD_ADD_LO12_NC = 519, // G(GLDM(S))
R_AARCH64_TLSLD_MOVW_G1 = 520, // G(GLDM(S)) - GOT
R_AARCH64_TLSLD_MOVW_G0_NC = 521, // G(GLDM(S)) - GOT
R_AARCH64_TLSLD_LD_PREL19 = 522, // G(GLDM(S)) - P
R_AARCH64_TLSLD_MOVW_DTPREL_G2 = 523, // DTPREL(S+A)
R_AARCH64_TLSLD_MOVW_DTPREL_G1 = 524, // DTPREL(S+A)
R_AARCH64_TLSLD_MOVW_DTPREL_G1_NC = 525, // DTPREL(S+A)
R_AARCH64_TLSLD_MOVW_DTPREL_G0 = 526, // DTPREL(S+A)
R_AARCH64_TLSLD_MOVW_DTPREL_G0_NC = 527, // DTPREL(S+A)
R_AARCH64_TLSLD_ADD_DTPREL_HI12 = 528, // DTPREL(S+A)
R_AARCH64_TLSLD_ADD_DTPREL_LO12 = 529, // DTPREL(S+A)
R_AARCH64_TLSLD_ADD_DTPREL_LO12_NC = 530, // DTPREL(S+A)
R_AARCH64_TLSLD_LDST8_DTPREL_LO12 = 531, // DTPREL(S+A)
R_AARCH64_TLSLD_LDST8_DTPREL_LO12_NC = 532, // DTPREL(S+A)
R_AARCH64_TLSLD_LDST16_DTPREL_LO12 = 533, // DTPREL(S+A)
R_AARCH64_TLSLD_LDST16_DTPREL_LO12_NC = 534, // DTPREL(S+A)
R_AARCH64_TLSLD_LDST32_DTPREL_LO12 = 535, // DTPREL(S+A)
R_AARCH64_TLSLD_LDST32_DTPREL_LO12_NC = 536, // DTPREL(S+A)
R_AARCH64_TLSLD_LDST64_DTPREL_LO12 = 537, // DTPREL(S+A)
R_AARCH64_TLSLD_LDST64_DTPREL_LO12_NC = 538, // DTPREL(S+A)
R_AARCH64_TLSIE_MOVW_GOTTPREL_G1 = 539, // G(GTPREL(S+A)) - GOT
R_AARCH64_TLSIE_MOVW_GOTTPREL_G0_NC = 540, // G(GTPREL(S+A)) - GOT
R_AARCH64_TLSIE_ADR_GOTTPREL_PAGE21 = 541, // Page(G(GTPREL(S+A)))-Page(P)
R_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC = 542, // G(GTPREL(S+A))
R_AARCH64_TLSIE_LD_GOTTPREL_PREL19 = 543, // G(GTPREL(S+A)) - P
R_AARCH64_TLSLE_MOVW_TPREL_G2 = 544, // TPREL(S+A)
R_AARCH64_TLSLE_MOVW_TPREL_G1 = 545, // TPREL(S+A)
R_AARCH64_TLSLE_MOVW_TPREL_G1_NC = 546, // TPREL(S+A)
R_AARCH64_TLSLE_MOVW_TPREL_G0 = 547, // TPREL(S+A)
R_AARCH64_TLSLE_MOVW_TPREL_G0_NC = 548, // TPREL(S+A)
R_AARCH64_TLSLE_ADD_TPREL_HI12 = 549, // TPREL(S+A)
R_AARCH64_TLSLE_ADD_TPREL_LO12 = 550, // TPREL(S+A)
R_AARCH64_TLSLE_ADD_TPREL_LO12_NC = 551, // TPREL(S+A)
R_AARCH64_TLSLE_LDST8_TPREL_LO12 = 552, // TPREL(S+A)
R_AARCH64_TLSLE_LDST8_TPREL_LO12_NC = 553, // TPREL(S+A)
R_AARCH64_TLSLE_LDST16_TPREL_LO12 = 554, // TPREL(S+A)
R_AARCH64_TLSLE_LSDT16_TPREL_LO12_NC = 555, // TPREL(S+A)
R_AARCH64_TLSLE_LDST32_TPREL_LO12 = 556, // TPREL(S+A)
R_AARCH64_TLSLE_LDST32_TPREL_LO12_NC = 557, // TPREL(S+A)
R_AARCH64_TLSLE_LDST64_TPREL_LO12 = 558, // TPREL(S+A)
R_AARCH64_TLSLE_LDST64_TPREL_LO12_NC = 559, // TPREL(S+A)
R_AARCH64_TLSDESC_LD_PREL19 = 560, // G(GTLSDESC(S+A)) - P
R_AARCH64_TLSDESC_ADR_PREL21 = 561, // G(GTLSDESC(S+A)) - P
R_AARCH64_TLSDESC_ADR_PAGE21 = 562, // Page(G(GTLSDESC(S+A)))-Page(P)
R_AARCH64_TLSDESC_LD64_LO12 = 563, // G(GTLSDESC(S+A))
R_AARCH64_TLSDESC_ADD_LO12 = 564, // G(GTLSDESC(S+A))
R_AARCH64_TLSDESC_OFF_G1 = 565, // G(GTLSDESC(S+A)) - GOT
R_AARCH64_TLSDESC_OFF_G0_NC = 566, // G(GTLSDESC(S+A)) - GOT
R_AARCH64_TLSDESC_LDR = 567, // None
R_AARCH64_TLSDESC_ADD = 568, // None
R_AARCH64_TLSDESC_CALL = 569, // None
R_AARCH64_TLSLE_LDST128_TPREL_LO12 = 570, // TPREL(S+A)
R_AARCH64_TLSLE_LDST128_TPREL_LO12_NC = 571, // TPREL(S+A)
R_AARCH64_TLSLD_LDST128_DTPREL_LO12 = 572, // DTPREL(S+A)
R_AARCH64_TLSLD_LDST128_DTPREL_LO12_NC = 573, // DTPREL(S+A)
// Dynamic relocations
R_AARCH64_COPY = 1024,
R_AARCH64_GLOB_DAT = 1025, // S + A
R_AARCH64_JUMP_SLOT = 1026, // S + A
R_AARCH64_RELATIVE = 1027, // Delta(S) + A
// Note (shenhan): the following 2 relocs are different from elf spec from
// arm. In elf docs, TLS_DTPMOD64 is defined as 1029, TLS_DTPREL64 1028.
// While actually the bfd linker (and the dynamic linker) treates TLS_DTPMOD64
// as 1028, TLS_DTPREL64 1029. See binutils-gdb/include/elf/aarch64.h.
R_AARCH64_TLS_DTPMOD64 = 1028, // LDM(S)
R_AARCH64_TLS_DTPREL64 = 1029, // DTPREL(S+A)
R_AARCH64_TLS_TPREL64 = 1030, // TPREL(S+A)
R_AARCH64_TLSDESC = 1031, // TLSDESC(S+A)
R_AARCH64_IRELATIVE = 1032, // Indirect(Delta(S) + A)
};
} // End namespace elfcpp.
#endif // !defined(ELFCPP_AARCH64_H)
+1 -1
View File
@@ -1,6 +1,6 @@
// arm.h -- ELF definitions specific to EM_ARM -*- C++ -*-
// Copyright 2009, 2012 Free Software Foundation, Inc.
// Copyright (C) 2009-2014 Free Software Foundation, Inc.
// Written by Doug Kwan <dougkwan@google.com>.
// This file is part of elfcpp.
+1 -1
View File
@@ -1,6 +1,6 @@
// dwarf.h -- DWARF2 constants -*- C++ -*-
// Copyright 2006, 2007, 2008, 2011, 2012 Free Software Foundation, Inc.
// Copyright (C) 2006-2014 Free Software Foundation, Inc.
// Written by Ian Lance Taylor <iant@google.com>.
// This file is part of elfcpp.
+18 -7
View File
@@ -1,7 +1,6 @@
// elfcpp.h -- main header file for elfcpp -*- C++ -*-
// Copyright 2006, 2007, 2008, 2009, 2010, 2011, 2012
// Free Software Foundation, Inc.
// Copyright (C) 2006-2014 Free Software Foundation, Inc.
// Written by Ian Lance Taylor <iant@google.com>.
// This file is part of elfcpp.
@@ -247,7 +246,7 @@ enum EM
EM_MN10300 = 89,
EM_MN10200 = 90,
EM_PJ = 91,
EM_OPENRISC = 92,
EM_OR1K = 92,
EM_ARC_A5 = 93,
EM_XTENSA = 94,
EM_VIDEOCORE = 95,
@@ -269,6 +268,7 @@ enum EM
EM_UNICORE = 110,
EM_ALTERA_NIOS2 = 113,
EM_CRX = 114,
EM_AARCH64 = 183,
EM_TILEGX = 191,
// The Morph MT.
EM_MT = 0x2530,
@@ -289,7 +289,7 @@ enum EM
// Old AVR objects used 0x1057 (EM_AVR is correct).
// Old MSP430 objects used 0x1059 (EM_MSP430 is correct).
// Old FR30 objects used 0x3330 (EM_FR30 is correct).
// Old OpenRISC objects used 0x3426 and 0x8472 (EM_OPENRISC is correct).
// Old OpenRISC objects used 0x3426 and 0x8472 (EM_OR1K is correct).
// Old D10V objects used 0x7650 (EM_D10V is correct).
// Old D30V objects used 0x7676 (EM_D30V is correct).
// Old IP2X objects used 0x8217 (EM_IP2K is correct).
@@ -401,9 +401,14 @@ enum SHT
// x86_64 unwind information.
SHT_X86_64_UNWIND = 0x70000001,
//MIPS-specific section types.
// Register info section
// MIPS-specific section types.
// Section contains register usage information.
SHT_MIPS_REGINFO = 0x70000006,
// Section contains miscellaneous options.
SHT_MIPS_OPTIONS = 0x7000000d,
// AARCH64-specific section type.
SHT_AARCH64_ATTRIBUTES = 0x70000003,
// Link editor is to sort the entries in this section based on the
// address specified in the associated symbol table entry.
@@ -489,7 +494,13 @@ enum PT
// Runtime procedure table.
PT_MIPS_RTPROC = 0x70000001,
// .MIPS.options section.
PT_MIPS_OPTIONS = 0x70000002
PT_MIPS_OPTIONS = 0x70000002,
// .MIPS.abiflags section.
PT_MIPS_ABIFLAGS = 0x70000003,
// Platform architecture compatibility information
PT_AARCH64_ARCHEXT = 0x70000000,
// Exception unwind tables
PT_AARCH64_UNWIND = 0x70000001
};
// The valid bit flags found in the Phdr p_flags field.
+35 -5
View File
@@ -1,6 +1,6 @@
// elfcpp_file.h -- file access for elfcpp -*- C++ -*-
// Copyright 2006, 2007, Free Software Foundation, Inc.
// Copyright (C) 2006-2014 Free Software Foundation, Inc.
// Written by Ian Lance Taylor <iant@google.com>.
// This file is part of elfcpp.
@@ -144,6 +144,15 @@ class Elf_file
return this->shnum_;
}
unsigned int
shnum() const
{
if (this->shnum_ == 0 && this->shoff_ != 0)
this->file_->error(_("ELF file has not been initialized yet"
" (internal error)"));
return this->shnum_;
}
// Return the section index of the section name string table.
unsigned int
shstrndx()
@@ -152,6 +161,18 @@ class Elf_file
return this->shstrndx_;
}
unsigned int
shstrndx() const
{
if (this->shstrndx_ == SHN_XINDEX && this->shoff_ != 0)
{
this->file_->error(_("ELF file has not been initialized yet"
" (internal error)"));
return 0;
}
return this->shstrndx_;
}
// Return the value to subtract from section indexes >=
// SHN_LORESERVE. See the comment in initialize_shnum.
int
@@ -161,6 +182,15 @@ class Elf_file
return this->large_shndx_offset_;
}
int
large_shndx_offset() const
{
if (this->shstrndx_ == SHN_XINDEX && this->shoff_ != 0)
this->file_->error(_("ELF file has not been initialized yet"
" (internal error)"));
return this->large_shndx_offset_;
}
// Return the location of the header of section SHNDX.
typename File::Location
section_header(unsigned int shndx)
@@ -171,7 +201,7 @@ class Elf_file
// Return the name of section SHNDX.
std::string
section_name(unsigned int shndx);
section_name(unsigned int shndx) const;
// Return the location of the contents of section SHNDX.
typename File::Location
@@ -216,7 +246,7 @@ class Elf_file
// Return the file offset of the header of section SHNDX.
off_t
section_header_offset(unsigned int shndx);
section_header_offset(unsigned int shndx) const;
// The file we are reading.
File* file_;
@@ -465,7 +495,7 @@ Elf_file<size, big_endian, File>::find_section_by_type(unsigned int type)
template<int size, bool big_endian, typename File>
off_t
Elf_file<size, big_endian, File>::section_header_offset(unsigned int shndx)
Elf_file<size, big_endian, File>::section_header_offset(unsigned int shndx) const
{
if (shndx >= this->shnum())
this->file_->error(_("section_header_offset: bad shndx %u >= %u"),
@@ -477,7 +507,7 @@ Elf_file<size, big_endian, File>::section_header_offset(unsigned int shndx)
template<int size, bool big_endian, typename File>
std::string
Elf_file<size, big_endian, File>::section_name(unsigned int shndx)
Elf_file<size, big_endian, File>::section_name(unsigned int shndx) const
{
File* const file = this->file_;
+1 -1
View File
@@ -1,6 +1,6 @@
// elfcpp_internal.h -- internals for elfcpp -*- C++ -*-
// Copyright 2006, 2007, Free Software Foundation, Inc.
// Copyright (C) 2006-2014 Free Software Foundation, Inc.
// Written by Ian Lance Taylor <iant@google.com>.
// This file is part of elfcpp.
+1 -1
View File
@@ -1,6 +1,6 @@
// elfcpp_swap.h -- Handle swapping for elfcpp -*- C++ -*-
// Copyright 2006, 2007, 2008, 2009, 2012 Free Software Foundation, Inc.
// Copyright (C) 2006-2014 Free Software Foundation, Inc.
// Written by Ian Lance Taylor <iant@google.com>.
// This file is part of elfcpp.
+1 -1
View File
@@ -1,6 +1,6 @@
// i386.h -- ELF definitions specific to EM_386 -*- C++ -*-
// Copyright 2006, 2007, 2010 Free Software Foundation, Inc.
// Copyright (C) 2006-2014 Free Software Foundation, Inc.
// Written by Ian Lance Taylor <iant@google.com>.
// This file is part of elfcpp.
+132 -18
View File
@@ -1,7 +1,8 @@
// mips.h -- ELF definitions specific to EM_MIPS -*- C++ -*-
// Copyright 2012 Free Software Foundation, Inc.
// Written by Aleksandar Simeonov <aleksandar.simeonov@rt-rk.com>.
// Copyright (C) 2012-2014 Free Software Foundation, Inc.
// Written by Sasa Stankovic <sasa.stankovic@imgtec.com>
// and Aleksandar Simeonov <aleksandar.simeonov@rt-rk.com>.
// This file is part of elfcpp.
@@ -46,16 +47,16 @@ enum
{
R_MIPS_NONE = 0,
R_MIPS_16 = 1,
R_MIPS_32 = 2,
R_MIPS_REL32 = 3,
R_MIPS_32 = 2, // In Elf 64: alias R_MIPS_ADD
R_MIPS_REL32 = 3, // In Elf 64: alias R_MIPS_REL
R_MIPS_26 = 4,
R_MIPS_HI16 = 5,
R_MIPS_LO16 = 6,
R_MIPS_GPREL16 = 7,
R_MIPS_GPREL16 = 7, // In Elf 64: alias R_MIPS_GPREL
R_MIPS_LITERAL = 8,
R_MIPS_GOT16 = 9,
R_MIPS_GOT16 = 9, // In Elf 64: alias R_MIPS_GOT
R_MIPS_PC16 = 10,
R_MIPS_CALL16 = 11,
R_MIPS_CALL16 = 11, // In Elf 64: alias R_MIPS_CALL
R_MIPS_GPREL32 = 12,
R_MIPS_UNUSED1 = 13,
R_MIPS_UNUSED2 = 14,
@@ -69,48 +70,101 @@ enum
R_MIPS_GOT_HI16 = 22,
R_MIPS_GOT_LO16 = 23,
R_MIPS_SUB = 24,
R_MIPS_INSERT_A = 25, // Empty relocation
R_MIPS_INSERT_B = 26, // Empty relocation
R_MIPS_DELETE = 27, // Empty relocation
R_MIPS_INSERT_A = 25,
R_MIPS_INSERT_B = 26,
R_MIPS_DELETE = 27,
R_MIPS_HIGHER = 28,
R_MIPS_HIGHEST = 29,
R_MIPS_CALL_HI16 = 30,
R_MIPS_CALL_LO16 = 31,
R_MIPS_SCN_DISP = 32,
R_MIPS_REL16 = 33, // Empty relocation
R_MIPS_ADD_IMMEDIATE = 34, // Empty relocation
R_MIPS_PJUMP = 35, // Empty relocation
R_MIPS_RELGOT = 36, // Empty relocation
R_MIPS_REL16 = 33,
R_MIPS_ADD_IMMEDIATE = 34,
R_MIPS_PJUMP = 35,
R_MIPS_RELGOT = 36,
R_MIPS_JALR = 37,
// TLS relocations.
R_MIPS_TLS_DTPMOD32 = 38,
R_MIPS_TLS_DTPREL32 = 39,
R_MIPS_TLS_DTPMOD64 = 40, // Empty relocation
R_MIPS_TLS_DTPREL64 = 41, // Empty relocation
R_MIPS_TLS_DTPMOD64 = 40,
R_MIPS_TLS_DTPREL64 = 41,
R_MIPS_TLS_GD = 42,
R_MIPS_TLS_LDM = 43,
R_MIPS_TLS_DTPREL_HI16 = 44,
R_MIPS_TLS_DTPREL_LO16 = 45,
R_MIPS_TLS_GOTTPREL = 46,
R_MIPS_TLS_TPREL32 = 47,
R_MIPS_TLS_TPREL64 = 48, // Empty relocation
R_MIPS_TLS_TPREL64 = 48,
R_MIPS_TLS_TPREL_HI16 = 49,
R_MIPS_TLS_TPREL_LO16 = 50,
R_MIPS_GLOB_DAT = 51,
// These relocs are used for the mips16.
R_MIPS16_26 = 100,
R_MIPS16_GPREL = 101,
R_MIPS16_GOT16 = 102,
R_MIPS16_CALL16 = 103,
R_MIPS16_HI16 = 104,
R_MIPS16_LO16 = 105,
R_MIPS16_TLS_GD = 106,
R_MIPS16_TLS_LDM = 107,
R_MIPS16_TLS_DTPREL_HI16 = 108,
R_MIPS16_TLS_DTPREL_LO16 = 109,
R_MIPS16_TLS_GOTTPREL = 110,
R_MIPS16_TLS_TPREL_HI16 = 111,
R_MIPS16_TLS_TPREL_LO16 = 112,
R_MIPS_COPY = 126,
R_MIPS_JUMP_SLOT = 127,
// These relocations are specific to microMIPS.
R_MICROMIPS_26_S1 = 133,
R_MICROMIPS_HI16 = 134,
R_MICROMIPS_LO16 = 135,
R_MICROMIPS_GPREL16 = 136, // In Elf 64: alias R_MICROMIPS_GPREL
R_MICROMIPS_LITERAL = 137,
R_MICROMIPS_GOT16 = 138, // In Elf 64: alias R_MICROMIPS_GOT
R_MICROMIPS_PC7_S1 = 139,
R_MICROMIPS_PC10_S1 = 140,
R_MICROMIPS_PC16_S1 = 141,
R_MICROMIPS_CALL16 = 142, // In Elf 64: alias R_MICROMIPS_CALL
R_MICROMIPS_GOT_DISP = 145,
R_MICROMIPS_GOT_PAGE = 146,
R_MICROMIPS_GOT_OFST = 147,
R_MICROMIPS_GOT_HI16 = 148,
R_MICROMIPS_GOT_LO16 = 149,
R_MICROMIPS_SUB = 150,
R_MICROMIPS_HIGHER = 151,
R_MICROMIPS_HIGHEST = 152,
R_MICROMIPS_CALL_HI16 = 153,
R_MICROMIPS_CALL_LO16 = 154,
R_MICROMIPS_SCN_DISP = 155,
R_MICROMIPS_JALR = 156,
R_MICROMIPS_HI0_LO16 = 157,
// TLS relocations.
R_MICROMIPS_TLS_GD = 162,
R_MICROMIPS_TLS_LDM = 163,
R_MICROMIPS_TLS_DTPREL_HI16 = 164,
R_MICROMIPS_TLS_DTPREL_LO16 = 165,
R_MICROMIPS_TLS_GOTTPREL = 166,
R_MICROMIPS_TLS_TPREL_HI16 = 169,
R_MICROMIPS_TLS_TPREL_LO16 = 170,
// microMIPS GP- and PC-relative relocations.
R_MICROMIPS_GPREL7_S2 = 172,
R_MICROMIPS_PC23_S2 = 173,
// This was a GNU extension used by embedded-PIC. It was co-opted by
// mips-linux for exception-handling data. GCC stopped using it in
// May, 2004, then started using it again for compact unwind tables.
R_MIPS_PC32 = 248,
R_MIPS_EH = 249,
// This relocation is used internally by gas.
R_MIPS_GNU_REL16_S2 = 250,
// These are GNU extensions to enable C++ vtable garbage collection.
R_MIPS_GNU_VTINHERIT = 253,
R_MIPS_GNU_VTENTRY = 254
};
// Processor specific flags for the ELF header e_flags field. */
// Processor specific flags for the ELF header e_flags field.
enum
{
// At least one .noreorder directive appears in the source.
@@ -164,6 +218,7 @@ enum
E_MIPS_MACH_OCTEON = 0x008b0000,
E_MIPS_MACH_XLR = 0x008c0000,
E_MIPS_MACH_OCTEON2 = 0x008d0000,
E_MIPS_MACH_OCTEON3 = 0x008e0000,
E_MIPS_MACH_5400 = 0x00910000,
E_MIPS_MACH_5500 = 0x00980000,
E_MIPS_MACH_9000 = 0x00990000,
@@ -195,6 +250,10 @@ enum
E_MIPS_ARCH_32R2 = 0x70000000,
// -mips64r2 code.
E_MIPS_ARCH_64R2 = 0x80000000,
// -mips32r6 code.
E_MIPS_ARCH_32R6 = 0x90000000,
// -mips64r6 code.
E_MIPS_ARCH_64R6 = 0xa0000000,
};
enum
@@ -235,6 +294,10 @@ enum
// Note that one of the MIPS16 bits overlaps with STO_MIPS_PIC.
STO_MIPS_ISA = 0xc0,
// The mask spanning the rest of MIPS psABI flags. At most one is expected
// to be set except for STO_MIPS16.
STO_MIPS_FLAGS = ~(STO_MIPS_ISA | 0x3),
// The MIPS psABI was updated in 2008 with support for PLTs and copy
// relocs. There are therefore two types of nonzero SHN_UNDEF functions:
// PLT entries and traditional MIPS lazy binding stubs. We mark the former
@@ -262,6 +325,57 @@ enum
DTP_OFFSET = 0x8000
};
bool
elf_st_is_mips16(unsigned char st_other)
{ return (st_other & elfcpp::STO_MIPS16) == elfcpp::STO_MIPS16; }
bool
elf_st_is_micromips(unsigned char st_other)
{ return (st_other & elfcpp::STO_MIPS_ISA) == elfcpp::STO_MICROMIPS; }
// Whether the ABI is N32.
bool
abi_n32(elfcpp::Elf_Word e_flags)
{ return (e_flags & elfcpp::EF_MIPS_ABI2) != 0; }
// Whether the ABI is N64.
bool
abi_64(unsigned char ei_class)
{ return ei_class == elfcpp::ELFCLASS64; }
// Whether the file has microMIPS code.
bool
is_micromips(elfcpp::Elf_Word e_flags)
{ return (e_flags & elfcpp::EF_MIPS_ARCH_ASE_MICROMIPS) != 0; }
// Values which may appear in the kind field of an Elf_Options structure.
enum
{
// Undefined.
ODK_NULL = 0,
// Register usage and GP value.
ODK_REGINFO = 1,
// Exception processing information.
ODK_EXCEPTIONS = 2,
// Section padding information.
ODK_PAD = 3,
// Hardware workarounds performed.
ODK_HWPATCH = 4,
// Fill value used by the linker.
ODK_FILL = 5,
// Reserved space for desktop tools.
ODK_TAGS = 6,
// Hardware workarounds, AND bits when merging.
ODK_HWAND = 7,
// Hardware workarounds, OR bits when merging.
ODK_HWOR = 8,
// GP group to use for text/data sections.
ODK_GP_GROUP = 9,
// ID information.
ODK_IDENT = 10
};
} // End namespace elfcpp.
#endif // !defined(ELFCPP_MIPS_H)
+3 -1
View File
@@ -1,6 +1,6 @@
// powerpc.h -- ELF definitions specific to EM_PPC and EM_PPC64 -*- C++ -*-
// Copyright 2008, 2010, 2012, 2013 Free Software Foundation, Inc.
// Copyright (C) 2008-2014 Free Software Foundation, Inc.
// Written by David S. Miller <davem@davemloft.net>.
// This file is part of elfcpp.
@@ -176,6 +176,8 @@ enum
R_PPC_EMB_BIT_FLD = 115,
R_PPC64_DTPREL16_HIGHA = 115,
R_PPC_EMB_RELSDA = 116,
R_PPC64_REL24_NOTOC = 116,
R_PPC64_ADDR64_LOCAL = 117,
R_PPC_VLE_REL8 = 216,
R_PPC_VLE_REL15 = 217,
+1 -1
View File
@@ -1,6 +1,6 @@
// sparc.h -- ELF definitions specific to EM_SPARC -*- C++ -*-
// Copyright 2008, 2010 Free Software Foundation, Inc.
// Copyright (C) 2008-2014 Free Software Foundation, Inc.
// Written by David S. Miller <davem@davemloft.net>.
// This file is part of elfcpp.
+1 -1
View File
@@ -1,6 +1,6 @@
// tilegx.h -- ELF definitions specific to EM_TILEGX -*- C++ -*-
// Copyright 2012 Free Software Foundation, Inc.
// Copyright (C) 2012-2014 Free Software Foundation, Inc.
// Written by Jiong Wang (jiwang@tilera.com)
// This file is part of elfcpp.
+1 -1
View File
@@ -1,6 +1,6 @@
// x86-64.h -- ELF definitions specific to EM_X86_64 -*- C++ -*-
// Copyright 2006, 2007, 2010 Free Software Foundation, Inc.
// Copyright (C) 2006-2014 Free Software Foundation, Inc.
// Written by Andrew Chatham.
// This file is part of elfcpp.