BFD_RELOC_8_GOT_PCREL,
BFD_RELOC_32_GOTOFF,
BFD_RELOC_16_GOTOFF,
+ BFD_RELOC_LO16_GOTOFF,
+ BFD_RELOC_HI16_GOTOFF,
+ BFD_RELOC_HI16_S_GOTOFF,
BFD_RELOC_8_GOTOFF,
BFD_RELOC_32_PLT_PCREL,
+ BFD_RELOC_24_PLT_PCREL,
BFD_RELOC_16_PLT_PCREL,
BFD_RELOC_8_PLT_PCREL,
BFD_RELOC_32_PLTOFF,
BFD_RELOC_16_PLTOFF,
+ BFD_RELOC_LO16_PLTOFF,
+ BFD_RELOC_HI16_PLTOFF,
+ BFD_RELOC_HI16_S_PLTOFF,
BFD_RELOC_8_PLTOFF,
/* Relocations used by 68K ELF. */
/* Linkage-table relative. */
BFD_RELOC_32_BASEREL,
BFD_RELOC_16_BASEREL,
+ BFD_RELOC_LO16_BASEREL,
+ BFD_RELOC_HI16_BASEREL,
+ BFD_RELOC_HI16_S_BASEREL,
BFD_RELOC_8_BASEREL,
BFD_RELOC_RVA,
BFD_RELOC_NS32K_DISP_16_PCREL,
BFD_RELOC_NS32K_DISP_32_PCREL,
-/* PowerPC/POWER (RS/6000) relocs.
-26 bit relative branch. Low two bits must be zero. High 24
-bits installed in bits 6 through 29 of instruction. */
+/* Power(rs6000) and PowerPC relocations. */
BFD_RELOC_PPC_B26,
-
-/* 26 bit absolute branch, like BFD_RELOC_PPC_B26 but absolute. */
BFD_RELOC_PPC_BA26,
-
-/* 16 bit TOC relative reference. */
BFD_RELOC_PPC_TOC16,
+ BFD_RELOC_PPC_B16,
+ BFD_RELOC_PPC_B16_BRTAKEN,
+ BFD_RELOC_PPC_B16_BRNTAKEN,
+ BFD_RELOC_PPC_BA16,
+ BFD_RELOC_PPC_BA16_BRTAKEN,
+ BFD_RELOC_PPC_BA16_BRNTAKEN,
+ BFD_RELOC_PPC_COPY,
+ BFD_RELOC_PPC_GLOB_DAT,
+ BFD_RELOC_PPC_JMP_SLOT,
+ BFD_RELOC_PPC_RELATIVE,
+ BFD_RELOC_PPC_LOCAL24PC,
/* The type of reloc used to build a contructor table - at the moment
probably a 32 bit wide absolute relocation, but the target can choose.
R_PPC_GOT16_LO, /* 15 */
R_PPC_GOT16_HI, /* 16 */
R_PPC_GOT16_HA, /* 17 */
- R_PPC_PLT24, /* 18 */
+ R_PPC_PLTREL24, /* 18 */
R_PPC_COPY, /* 19 */
- R_PPC_GLOB_DAT, /* 20 -- not in final System V spec */
+ R_PPC_GLOB_DAT, /* 20 */
R_PPC_JMP_SLOT, /* 21 */
R_PPC_RELATIVE, /* 22 */
R_PPC_LOCAL24PC, /* 23 */
R_PPC_PLT16_LO, /* 29 */
R_PPC_PLT16_HI, /* 30 */
R_PPC_PLT16_HA, /* 31 */
- R_PPC_SDAREL, /* 32 */
+ R_PPC_SDAREL16, /* 32 */
/* Relocations added by Sun. */
R_PPC_SECTOFF, /* 33 */
FIXME: we don't check that, we just clear them. */
HOWTO (R_PPC_ADDR14, /* type */
0, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 1, /* size (0 = byte, 1 = short, 2 = long) */
16, /* bitsize */
false, /* pc_relative */
0, /* bitpos */
bits must be zero. */
HOWTO (R_PPC_ADDR14_BRTAKEN, /* type */
0, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 1, /* size (0 = byte, 1 = short, 2 = long) */
16, /* bitsize */
false, /* pc_relative */
0, /* bitpos */
two bits must be zero. */
HOWTO (R_PPC_ADDR14_BRNTAKEN, /* type */
0, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 1, /* size (0 = byte, 1 = short, 2 = long) */
16, /* bitsize */
false, /* pc_relative */
0, /* bitpos */
/* A relative 16 bit branch; the lower two bits must be zero. */
HOWTO (R_PPC_REL14, /* type */
0, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 1, /* size (0 = byte, 1 = short, 2 = long) */
16, /* bitsize */
true, /* pc_relative */
0, /* bitpos */
zero. */
HOWTO (R_PPC_REL14_BRTAKEN, /* type */
0, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 1, /* size (0 = byte, 1 = short, 2 = long) */
16, /* bitsize */
- false, /* pc_relative */
+ true, /* pc_relative */
0, /* bitpos */
complain_overflow_signed, /* complain_on_overflow */
- ppc_elf_unsupported_reloc, /* special_function */
+ ppc_elf_std_reloc, /* special_function */
"R_PPC_REL14_BRTAKEN", /* name */
false, /* partial_inplace */
0, /* src_mask */
be zero. */
HOWTO (R_PPC_REL14_BRNTAKEN, /* type */
0, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 1, /* size (0 = byte, 1 = short, 2 = long) */
16, /* bitsize */
- false, /* pc_relative */
+ true, /* pc_relative */
0, /* bitpos */
complain_overflow_signed, /* complain_on_overflow */
- ppc_elf_unsupported_reloc, /* special_function */
+ ppc_elf_std_reloc, /* special_function */
"R_PPC_REL14_BRNTAKEN",/* name */
false, /* partial_inplace */
0, /* src_mask */
/* Like R_PPC_REL24, but referring to the procedure linkage table
entry for the symbol. FIXME: Not supported. */
- HOWTO (R_PPC_PLT24, /* type */
+ HOWTO (R_PPC_PLTREL24, /* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
26, /* bitsize */
0, /* bitpos */
complain_overflow_signed, /* complain_on_overflow */
ppc_elf_std_reloc, /* special_function */
- "R_PPC_PLT24", /* name */
+ "R_PPC_PLTREL24", /* name */
false, /* partial_inplace */
0, /* src_mask */
0x3fffffc, /* dst_mask */
/* A sign-extended 16 bit value relative to _SDA_BASE, for use with
small data items. */
- HOWTO (R_PPC_SDAREL, /* type */
+ HOWTO (R_PPC_SDAREL16, /* type */
0, /* rightshift */
1, /* size (0 = byte, 1 = short, 2 = long) */
16, /* bitsize */
0, /* bitpos */
complain_overflow_signed, /* complain_on_overflow */
ppc_elf_got16_reloc, /* special_function */
- "R_PPC_SDAREL", /* name */
+ "R_PPC_SDAREL16", /* name */
false, /* partial_inplace */
0, /* src_mask */
0xffff, /* dst_mask */
bfd *abfd;
bfd_reloc_code_real_type code;
{
+ enum reloc_type ppc_reloc = R_PPC_NONE;
+
if (!ppc_elf_howto_table[ R_PPC_ADDR32 ]) /* Initialize howto table if needed */
ppc_elf_howto_init ();
switch ((int)code)
{
- case BFD_RELOC_NONE: return ppc_elf_howto_table[ (int) R_PPC_NONE ];
- case BFD_RELOC_32: return ppc_elf_howto_table[ (int) R_PPC_ADDR32 ];
- case BFD_RELOC_32_PCREL: return ppc_elf_howto_table[ (int) R_PPC_REL32 ];
- case BFD_RELOC_CTOR: return ppc_elf_howto_table[ (int) R_PPC_ADDR32 ];
- case BFD_RELOC_PPC_B26: return ppc_elf_howto_table[ (int) R_PPC_REL24 ];
- case BFD_RELOC_PPC_BA26: return ppc_elf_howto_table[ (int) R_PPC_ADDR24 ];
- case BFD_RELOC_PPC_TOC16: return ppc_elf_howto_table[ (int) R_PPC_GOT16 ];
- case BFD_RELOC_LO16: return ppc_elf_howto_table[ (int) R_PPC_ADDR16_LO ];
- case BFD_RELOC_HI16: return ppc_elf_howto_table[ (int) R_PPC_ADDR16_HI ];
- case BFD_RELOC_HI16_S: return ppc_elf_howto_table[ (int) R_PPC_ADDR16_HA ];
- case BFD_RELOC_GPREL16: return ppc_elf_howto_table[ (int) R_PPC_SDAREL ];
+ default:
+ return (reloc_howto_type *)NULL;
+
+ case BFD_RELOC_NONE: ppc_reloc = R_PPC_NONE; break;
+ case BFD_RELOC_32: ppc_reloc = R_PPC_ADDR32; break;
+ case BFD_RELOC_PPC_BA26: ppc_reloc = R_PPC_ADDR24; break;
+ case BFD_RELOC_16: ppc_reloc = R_PPC_ADDR16; break;
+ case BFD_RELOC_LO16: ppc_reloc = R_PPC_ADDR16_LO; break;
+ case BFD_RELOC_HI16: ppc_reloc = R_PPC_ADDR16_HI; break;
+ case BFD_RELOC_HI16_S: ppc_reloc = R_PPC_ADDR16_HA; break;
+ case BFD_RELOC_PPC_BA16: ppc_reloc = R_PPC_ADDR14; break;
+ case BFD_RELOC_PPC_BA16_BRTAKEN: ppc_reloc = R_PPC_ADDR14_BRTAKEN; break;
+ case BFD_RELOC_PPC_BA16_BRNTAKEN: ppc_reloc = R_PPC_ADDR14_BRNTAKEN; break;
+ case BFD_RELOC_PPC_B26: ppc_reloc = R_PPC_REL24; break;
+ case BFD_RELOC_PPC_B16: ppc_reloc = R_PPC_REL14; break;
+ case BFD_RELOC_PPC_B16_BRTAKEN: ppc_reloc = R_PPC_REL14_BRTAKEN; break;
+ case BFD_RELOC_PPC_B16_BRNTAKEN: ppc_reloc = R_PPC_REL14_BRNTAKEN; break;
+ case BFD_RELOC_PPC_TOC16: ppc_reloc = R_PPC_GOT16; break;
+ case BFD_RELOC_LO16_GOTOFF: ppc_reloc = R_PPC_GOT16_LO; break;
+ case BFD_RELOC_HI16_GOTOFF: ppc_reloc = R_PPC_GOT16_HI; break;
+ case BFD_RELOC_HI16_S_GOTOFF: ppc_reloc = R_PPC_GOT16_HA; break;
+ case BFD_RELOC_24_PLT_PCREL: ppc_reloc = R_PPC_PLTREL24; break;
+ case BFD_RELOC_PPC_COPY: ppc_reloc = R_PPC_COPY; break;
+ case BFD_RELOC_PPC_GLOB_DAT: ppc_reloc = R_PPC_GLOB_DAT; break;
+ case BFD_RELOC_PPC_LOCAL24PC: ppc_reloc = R_PPC_LOCAL24PC; break;
+ case BFD_RELOC_32_PCREL: ppc_reloc = R_PPC_REL32; break;
+ case BFD_RELOC_32_PLTOFF: ppc_reloc = R_PPC_PLT32; break;
+ case BFD_RELOC_32_PLT_PCREL: ppc_reloc = R_PPC_PLTREL32; break;
+ case BFD_RELOC_LO16_PLTOFF: ppc_reloc = R_PPC_PLT16_LO; break;
+ case BFD_RELOC_HI16_PLTOFF: ppc_reloc = R_PPC_PLT16_HI; break;
+ case BFD_RELOC_HI16_S_PLTOFF: ppc_reloc = R_PPC_PLT16_HA; break;
+ case BFD_RELOC_GPREL16: ppc_reloc = R_PPC_SDAREL16; break;
+ case BFD_RELOC_32_BASEREL: ppc_reloc = R_PPC_SECTOFF; break;
+ case BFD_RELOC_LO16_BASEREL: ppc_reloc = R_PPC_SECTOFF_LO; break;
+ case BFD_RELOC_HI16_BASEREL: ppc_reloc = R_PPC_SECTOFF_HI; break;
+ case BFD_RELOC_HI16_S_BASEREL: ppc_reloc = R_PPC_SECTOFF_HA; break;
+ case BFD_RELOC_CTOR: ppc_reloc = R_PPC_ADDR32; break;
}
- return (reloc_howto_type *)NULL;
+ return ppc_elf_howto_table[ (int)ppc_reloc ];
};
/* Set the howto pointer for a PowerPC ELF reloc. */
case (int)R_PPC_GOT16: /* GOT16 relocations */
case (int)R_PPC_GOT16_LO:
case (int)R_PPC_GOT16_HI:
- case (int)R_PPC_SDAREL:
+ case (int)R_PPC_SDAREL16:
BFD_ASSERT (sec != (asection *)0);
addend += ppc_elf_got16_inner (sec);
break;
extern const bfd_target * const bfd_target_vector[];
extern const bfd_target * const bfd_default_vector[];
-/* A function shared by the ECOFF and MIPS ELF backends, which have no
+/* Functions shared by the ECOFF and MIPS ELF backends, which have no
other common header files. */
#if defined(__STDC__) || defined(ALMOST_STDC)
struct ecoff_find_line;
#endif
-extern boolean
-_bfd_ecoff_locate_line
+extern boolean _bfd_ecoff_locate_line
PARAMS ((bfd *, asection *, bfd_vma, struct ecoff_debug_info * const,
const struct ecoff_debug_swap * const, struct ecoff_find_line *,
const char **, const char **, unsigned int *));
+extern boolean _bfd_ecoff_get_accumulated_pdr PARAMS ((PTR, bfd_byte *));
+extern boolean _bfd_ecoff_get_accumulated_sym PARAMS ((PTR, bfd_byte *));
+extern boolean _bfd_ecoff_get_accumulated_ss PARAMS ((PTR, bfd_byte *));
/* And more follows */
"BFD_RELOC_8_GOT_PCREL",
"BFD_RELOC_32_GOTOFF",
"BFD_RELOC_16_GOTOFF",
+ "BFD_RELOC_LO16_GOTOFF",
+ "BFD_RELOC_HI16_GOTOFF",
+ "BFD_RELOC_HI16_S_GOTOFF",
"BFD_RELOC_8_GOTOFF",
"BFD_RELOC_32_PLT_PCREL",
+ "BFD_RELOC_24_PLT_PCREL",
"BFD_RELOC_16_PLT_PCREL",
"BFD_RELOC_8_PLT_PCREL",
"BFD_RELOC_32_PLTOFF",
"BFD_RELOC_16_PLTOFF",
+ "BFD_RELOC_LO16_PLTOFF",
+ "BFD_RELOC_HI16_PLTOFF",
+ "BFD_RELOC_HI16_S_PLTOFF",
"BFD_RELOC_8_PLTOFF",
"BFD_RELOC_68K_GLOB_DAT",
"BFD_RELOC_68K_JMP_SLOT",
"BFD_RELOC_68K_RELATIVE",
"BFD_RELOC_32_BASEREL",
"BFD_RELOC_16_BASEREL",
+ "BFD_RELOC_LO16_BASEREL",
+ "BFD_RELOC_HI16_BASEREL",
+ "BFD_RELOC_HI16_S_BASEREL",
"BFD_RELOC_8_BASEREL",
"BFD_RELOC_RVA",
"BFD_RELOC_8_FFnn",
"BFD_RELOC_PPC_B26",
"BFD_RELOC_PPC_BA26",
"BFD_RELOC_PPC_TOC16",
+ "BFD_RELOC_PPC_B16",
+ "BFD_RELOC_PPC_B16_BRTAKEN",
+ "BFD_RELOC_PPC_B16_BRNTAKEN",
+ "BFD_RELOC_PPC_BA16",
+ "BFD_RELOC_PPC_BA16_BRTAKEN",
+ "BFD_RELOC_PPC_BA16_BRNTAKEN",
+ "BFD_RELOC_PPC_COPY",
+ "BFD_RELOC_PPC_GLOB_DAT",
+ "BFD_RELOC_PPC_JMP_SLOT",
+ "BFD_RELOC_PPC_RELATIVE",
+ "BFD_RELOC_PPC_LOCAL24PC",
"BFD_RELOC_CTOR",
"BFD_RELOC_ARM_PCREL_BRANCH",
"BFD_RELOC_ARM_IMMEDIATE",