/* PowerPC-specific support for 32-bit ELF
- Copyright (C) 1994-2018 Free Software Foundation, Inc.
+ Copyright (C) 1994-2019 Free Software Foundation, Inc.
Written by Ian Lance Taylor, Cygnus Support.
This file is part of BFD, the Binary File Descriptor library.
+ (SYM)->root.u.def.section->output_offset \
+ (SYM)->root.u.def.value)
\f
+/* Relocation HOWTO's. */
+/* Like other ELF RELA targets that don't apply multiple
+ field-altering relocations to the same localation, src_mask is
+ always zero and pcrel_offset is the same as pc_relative.
+ PowerPC can always use a zero bitpos, even when the field is not at
+ the LSB. For example, a REL24 could use rightshift=2, bisize=24
+ and bitpos=2 which matches the ABI description, or as we do here,
+ rightshift=0, bitsize=26 and bitpos=0. */
+#define HOW(type, size, bitsize, mask, rightshift, pc_relative, \
+ complain, special_func) \
+ HOWTO (type, rightshift, size, bitsize, pc_relative, 0, \
+ complain_overflow_ ## complain, special_func, \
+ #type, FALSE, 0, mask, pc_relative)
+
static reloc_howto_type *ppc_elf_howto_table[R_PPC_max];
static reloc_howto_type ppc_elf_howto_raw[] = {
/* This reloc does nothing. */
- HOWTO (R_PPC_NONE, /* type */
- 0, /* rightshift */
- 3, /* size (0 = byte, 1 = short, 2 = long) */
- 0, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_dont, /* complain_on_overflow */
- bfd_elf_generic_reloc, /* special_function */
- "R_PPC_NONE", /* name */
- FALSE, /* partial_inplace */
- 0, /* src_mask */
- 0, /* dst_mask */
- FALSE), /* pcrel_offset */
+ HOW (R_PPC_NONE, 3, 0, 0, 0, FALSE, dont,
+ bfd_elf_generic_reloc),
/* A standard 32 bit relocation. */
- HOWTO (R_PPC_ADDR32, /* type */
- 0, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
- 32, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_dont, /* complain_on_overflow */
- bfd_elf_generic_reloc, /* special_function */
- "R_PPC_ADDR32", /* name */
- FALSE, /* partial_inplace */
- 0, /* src_mask */
- 0xffffffff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ HOW (R_PPC_ADDR32, 2, 32, 0xffffffff, 0, FALSE, dont,
+ bfd_elf_generic_reloc),
/* An absolute 26 bit branch; the lower two bits must be zero.
FIXME: we don't check that, we just clear them. */
- HOWTO (R_PPC_ADDR24, /* type */
- 0, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
- 26, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_signed, /* complain_on_overflow */
- bfd_elf_generic_reloc, /* special_function */
- "R_PPC_ADDR24", /* name */
- FALSE, /* partial_inplace */
- 0, /* src_mask */
- 0x3fffffc, /* dst_mask */
- FALSE), /* pcrel_offset */
+ HOW (R_PPC_ADDR24, 2, 26, 0x3fffffc, 0, FALSE, signed,
+ bfd_elf_generic_reloc),
/* A standard 16 bit relocation. */
- HOWTO (R_PPC_ADDR16, /* type */
- 0, /* rightshift */
- 1, /* size (0 = byte, 1 = short, 2 = long) */
- 16, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_bitfield, /* complain_on_overflow */
- bfd_elf_generic_reloc, /* special_function */
- "R_PPC_ADDR16", /* name */
- FALSE, /* partial_inplace */
- 0, /* src_mask */
- 0xffff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ HOW (R_PPC_ADDR16, 1, 16, 0xffff, 0, FALSE, bitfield,
+ bfd_elf_generic_reloc),
/* A 16 bit relocation without overflow. */
- HOWTO (R_PPC_ADDR16_LO, /* type */
- 0, /* rightshift */
- 1, /* size (0 = byte, 1 = short, 2 = long) */
- 16, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_dont,/* complain_on_overflow */
- bfd_elf_generic_reloc, /* special_function */
- "R_PPC_ADDR16_LO", /* name */
- FALSE, /* partial_inplace */
- 0, /* src_mask */
- 0xffff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ HOW (R_PPC_ADDR16_LO, 1, 16, 0xffff, 0, FALSE, dont,
+ bfd_elf_generic_reloc),
/* The high order 16 bits of an address. */
- HOWTO (R_PPC_ADDR16_HI, /* type */
- 16, /* rightshift */
- 1, /* size (0 = byte, 1 = short, 2 = long) */
- 16, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_dont, /* complain_on_overflow */
- bfd_elf_generic_reloc, /* special_function */
- "R_PPC_ADDR16_HI", /* name */
- FALSE, /* partial_inplace */
- 0, /* src_mask */
- 0xffff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ HOW (R_PPC_ADDR16_HI, 1, 16, 0xffff, 16, FALSE, dont,
+ bfd_elf_generic_reloc),
/* The high order 16 bits of an address, plus 1 if the contents of
the low 16 bits, treated as a signed number, is negative. */
- HOWTO (R_PPC_ADDR16_HA, /* type */
- 16, /* rightshift */
- 1, /* size (0 = byte, 1 = short, 2 = long) */
- 16, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_dont, /* complain_on_overflow */
- ppc_elf_addr16_ha_reloc, /* special_function */
- "R_PPC_ADDR16_HA", /* name */
- FALSE, /* partial_inplace */
- 0, /* src_mask */
- 0xffff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ HOW (R_PPC_ADDR16_HA, 1, 16, 0xffff, 16, FALSE, dont,
+ ppc_elf_addr16_ha_reloc),
/* An absolute 16 bit branch; the lower two bits must be zero.
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) */
- 16, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_signed, /* complain_on_overflow */
- bfd_elf_generic_reloc, /* special_function */
- "R_PPC_ADDR14", /* name */
- FALSE, /* partial_inplace */
- 0, /* src_mask */
- 0xfffc, /* dst_mask */
- FALSE), /* pcrel_offset */
+ HOW (R_PPC_ADDR14, 2, 16, 0xfffc, 0, FALSE, signed,
+ bfd_elf_generic_reloc),
/* An absolute 16 bit branch, for which bit 10 should be set to
indicate that the branch is expected to be taken. The lower two
bits must be zero. */
- HOWTO (R_PPC_ADDR14_BRTAKEN, /* type */
- 0, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
- 16, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_signed, /* complain_on_overflow */
- bfd_elf_generic_reloc, /* special_function */
- "R_PPC_ADDR14_BRTAKEN",/* name */
- FALSE, /* partial_inplace */
- 0, /* src_mask */
- 0xfffc, /* dst_mask */
- FALSE), /* pcrel_offset */
+ HOW (R_PPC_ADDR14_BRTAKEN, 2, 16, 0xfffc, 0, FALSE, signed,
+ bfd_elf_generic_reloc),
/* An absolute 16 bit branch, for which bit 10 should be set to
indicate that the branch is not expected to be taken. The lower
two bits must be zero. */
- HOWTO (R_PPC_ADDR14_BRNTAKEN, /* type */
- 0, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
- 16, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_signed, /* complain_on_overflow */
- bfd_elf_generic_reloc, /* special_function */
- "R_PPC_ADDR14_BRNTAKEN",/* name */
- FALSE, /* partial_inplace */
- 0, /* src_mask */
- 0xfffc, /* dst_mask */
- FALSE), /* pcrel_offset */
+ HOW (R_PPC_ADDR14_BRNTAKEN, 2, 16, 0xfffc, 0, FALSE, signed,
+ bfd_elf_generic_reloc),
/* A relative 26 bit branch; the lower two bits must be zero. */
- HOWTO (R_PPC_REL24, /* type */
- 0, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
- 26, /* bitsize */
- TRUE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_signed, /* complain_on_overflow */
- bfd_elf_generic_reloc, /* special_function */
- "R_PPC_REL24", /* name */
- FALSE, /* partial_inplace */
- 0, /* src_mask */
- 0x3fffffc, /* dst_mask */
- TRUE), /* pcrel_offset */
+ HOW (R_PPC_REL24, 2, 26, 0x3fffffc, 0, TRUE, signed,
+ bfd_elf_generic_reloc),
/* 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) */
- 16, /* bitsize */
- TRUE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_signed, /* complain_on_overflow */
- bfd_elf_generic_reloc, /* special_function */
- "R_PPC_REL14", /* name */
- FALSE, /* partial_inplace */
- 0, /* src_mask */
- 0xfffc, /* dst_mask */
- TRUE), /* pcrel_offset */
+ HOW (R_PPC_REL14, 2, 16, 0xfffc, 0, TRUE, signed,
+ bfd_elf_generic_reloc),
/* A relative 16 bit branch. Bit 10 should be set to indicate that
the branch is expected to be taken. The lower two bits must be
zero. */
- HOWTO (R_PPC_REL14_BRTAKEN, /* type */
- 0, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
- 16, /* bitsize */
- TRUE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_signed, /* complain_on_overflow */
- bfd_elf_generic_reloc, /* special_function */
- "R_PPC_REL14_BRTAKEN", /* name */
- FALSE, /* partial_inplace */
- 0, /* src_mask */
- 0xfffc, /* dst_mask */
- TRUE), /* pcrel_offset */
+ HOW (R_PPC_REL14_BRTAKEN, 2, 16, 0xfffc, 0, TRUE, signed,
+ bfd_elf_generic_reloc),
/* A relative 16 bit branch. Bit 10 should be set to indicate that
the branch is not expected to be taken. The lower two bits must
be zero. */
- HOWTO (R_PPC_REL14_BRNTAKEN, /* type */
- 0, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
- 16, /* bitsize */
- TRUE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_signed, /* complain_on_overflow */
- bfd_elf_generic_reloc, /* special_function */
- "R_PPC_REL14_BRNTAKEN",/* name */
- FALSE, /* partial_inplace */
- 0, /* src_mask */
- 0xfffc, /* dst_mask */
- TRUE), /* pcrel_offset */
+ HOW (R_PPC_REL14_BRNTAKEN, 2, 16, 0xfffc, 0, TRUE, signed,
+ bfd_elf_generic_reloc),
/* Like R_PPC_ADDR16, but referring to the GOT table entry for the
symbol. */
- HOWTO (R_PPC_GOT16, /* type */
- 0, /* rightshift */
- 1, /* size (0 = byte, 1 = short, 2 = long) */
- 16, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_signed, /* complain_on_overflow */
- ppc_elf_unhandled_reloc, /* special_function */
- "R_PPC_GOT16", /* name */
- FALSE, /* partial_inplace */
- 0, /* src_mask */
- 0xffff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ HOW (R_PPC_GOT16, 1, 16, 0xffff, 0, FALSE, signed,
+ ppc_elf_unhandled_reloc),
/* Like R_PPC_ADDR16_LO, but referring to the GOT table entry for
the symbol. */
- HOWTO (R_PPC_GOT16_LO, /* type */
- 0, /* rightshift */
- 1, /* size (0 = byte, 1 = short, 2 = long) */
- 16, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_dont, /* complain_on_overflow */
- ppc_elf_unhandled_reloc, /* special_function */
- "R_PPC_GOT16_LO", /* name */
- FALSE, /* partial_inplace */
- 0, /* src_mask */
- 0xffff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ HOW (R_PPC_GOT16_LO, 1, 16, 0xffff, 0, FALSE, dont,
+ ppc_elf_unhandled_reloc),
/* Like R_PPC_ADDR16_HI, but referring to the GOT table entry for
the symbol. */
- HOWTO (R_PPC_GOT16_HI, /* type */
- 16, /* rightshift */
- 1, /* size (0 = byte, 1 = short, 2 = long) */
- 16, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_dont, /* complain_on_overflow */
- ppc_elf_unhandled_reloc, /* special_function */
- "R_PPC_GOT16_HI", /* name */
- FALSE, /* partial_inplace */
- 0, /* src_mask */
- 0xffff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ HOW (R_PPC_GOT16_HI, 1, 16, 0xffff, 16, FALSE, dont,
+ ppc_elf_unhandled_reloc),
/* Like R_PPC_ADDR16_HA, but referring to the GOT table entry for
the symbol. */
- HOWTO (R_PPC_GOT16_HA, /* type */
- 16, /* rightshift */
- 1, /* size (0 = byte, 1 = short, 2 = long) */
- 16, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_dont, /* complain_on_overflow */
- ppc_elf_unhandled_reloc, /* special_function */
- "R_PPC_GOT16_HA", /* name */
- FALSE, /* partial_inplace */
- 0, /* src_mask */
- 0xffff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ HOW (R_PPC_GOT16_HA, 1, 16, 0xffff, 16, FALSE, dont,
+ ppc_elf_unhandled_reloc),
/* Like R_PPC_REL24, but referring to the procedure linkage table
entry for the symbol. */
- HOWTO (R_PPC_PLTREL24, /* type */
- 0, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
- 26, /* bitsize */
- TRUE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_signed, /* complain_on_overflow */
- ppc_elf_unhandled_reloc, /* special_function */
- "R_PPC_PLTREL24", /* name */
- FALSE, /* partial_inplace */
- 0, /* src_mask */
- 0x3fffffc, /* dst_mask */
- TRUE), /* pcrel_offset */
+ HOW (R_PPC_PLTREL24, 2, 26, 0x3fffffc, 0, TRUE, signed,
+ ppc_elf_unhandled_reloc),
/* This is used only by the dynamic linker. The symbol should exist
both in the object being run and in some shared library. The
dynamic linker copies the data addressed by the symbol from the
shared library into the object, because the object being
run has to have the data at some particular address. */
- HOWTO (R_PPC_COPY, /* type */
- 0, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
- 32, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_dont, /* complain_on_overflow */
- ppc_elf_unhandled_reloc, /* special_function */
- "R_PPC_COPY", /* name */
- FALSE, /* partial_inplace */
- 0, /* src_mask */
- 0, /* dst_mask */
- FALSE), /* pcrel_offset */
+ HOW (R_PPC_COPY, 2, 32, 0, 0, FALSE, dont,
+ ppc_elf_unhandled_reloc),
/* Like R_PPC_ADDR32, but used when setting global offset table
entries. */
- HOWTO (R_PPC_GLOB_DAT, /* type */
- 0, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
- 32, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_dont, /* complain_on_overflow */
- ppc_elf_unhandled_reloc, /* special_function */
- "R_PPC_GLOB_DAT", /* name */
- FALSE, /* partial_inplace */
- 0, /* src_mask */
- 0xffffffff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ HOW (R_PPC_GLOB_DAT, 2, 32, 0xffffffff, 0, FALSE, dont,
+ ppc_elf_unhandled_reloc),
/* Marks a procedure linkage table entry for a symbol. */
- HOWTO (R_PPC_JMP_SLOT, /* type */
- 0, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
- 32, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_dont, /* complain_on_overflow */
- ppc_elf_unhandled_reloc, /* special_function */
- "R_PPC_JMP_SLOT", /* name */
- FALSE, /* partial_inplace */
- 0, /* src_mask */
- 0, /* dst_mask */
- FALSE), /* pcrel_offset */
+ HOW (R_PPC_JMP_SLOT, 2, 32, 0, 0, FALSE, dont,
+ ppc_elf_unhandled_reloc),
/* Used only by the dynamic linker. When the object is run, this
longword is set to the load address of the object, plus the
addend. */
- HOWTO (R_PPC_RELATIVE, /* type */
- 0, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
- 32, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_dont, /* complain_on_overflow */
- bfd_elf_generic_reloc, /* special_function */
- "R_PPC_RELATIVE", /* name */
- FALSE, /* partial_inplace */
- 0, /* src_mask */
- 0xffffffff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ HOW (R_PPC_RELATIVE, 2, 32, 0xffffffff, 0, FALSE, dont,
+ bfd_elf_generic_reloc),
/* Like R_PPC_REL24, but uses the value of the symbol within the
object rather than the final value. Normally used for
_GLOBAL_OFFSET_TABLE_. */
- HOWTO (R_PPC_LOCAL24PC, /* type */
- 0, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
- 26, /* bitsize */
- TRUE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_signed, /* complain_on_overflow */
- bfd_elf_generic_reloc, /* special_function */
- "R_PPC_LOCAL24PC", /* name */
- FALSE, /* partial_inplace */
- 0, /* src_mask */
- 0x3fffffc, /* dst_mask */
- TRUE), /* pcrel_offset */
+ HOW (R_PPC_LOCAL24PC, 2, 26, 0x3fffffc, 0, TRUE, signed,
+ bfd_elf_generic_reloc),
/* Like R_PPC_ADDR32, but may be unaligned. */
- HOWTO (R_PPC_UADDR32, /* type */
- 0, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
- 32, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_dont, /* complain_on_overflow */
- bfd_elf_generic_reloc, /* special_function */
- "R_PPC_UADDR32", /* name */
- FALSE, /* partial_inplace */
- 0, /* src_mask */
- 0xffffffff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ HOW (R_PPC_UADDR32, 2, 32, 0xffffffff, 0, FALSE, dont,
+ bfd_elf_generic_reloc),
/* Like R_PPC_ADDR16, but may be unaligned. */
- HOWTO (R_PPC_UADDR16, /* type */
- 0, /* rightshift */
- 1, /* size (0 = byte, 1 = short, 2 = long) */
- 16, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_bitfield, /* complain_on_overflow */
- bfd_elf_generic_reloc, /* special_function */
- "R_PPC_UADDR16", /* name */
- FALSE, /* partial_inplace */
- 0, /* src_mask */
- 0xffff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ HOW (R_PPC_UADDR16, 1, 16, 0xffff, 0, FALSE, bitfield,
+ bfd_elf_generic_reloc),
/* 32-bit PC relative */
- HOWTO (R_PPC_REL32, /* type */
- 0, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
- 32, /* bitsize */
- TRUE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_dont, /* complain_on_overflow */
- bfd_elf_generic_reloc, /* special_function */
- "R_PPC_REL32", /* name */
- FALSE, /* partial_inplace */
- 0, /* src_mask */
- 0xffffffff, /* dst_mask */
- TRUE), /* pcrel_offset */
+ HOW (R_PPC_REL32, 2, 32, 0xffffffff, 0, TRUE, dont,
+ bfd_elf_generic_reloc),
/* 32-bit relocation to the symbol's procedure linkage table.
FIXME: not supported. */
- HOWTO (R_PPC_PLT32, /* type */
- 0, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
- 32, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_dont, /* complain_on_overflow */
- ppc_elf_unhandled_reloc, /* special_function */
- "R_PPC_PLT32", /* name */
- FALSE, /* partial_inplace */
- 0, /* src_mask */
- 0, /* dst_mask */
- FALSE), /* pcrel_offset */
+ HOW (R_PPC_PLT32, 2, 32, 0, 0, FALSE, dont,
+ ppc_elf_unhandled_reloc),
/* 32-bit PC relative relocation to the symbol's procedure linkage table.
FIXME: not supported. */
- HOWTO (R_PPC_PLTREL32, /* type */
- 0, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
- 32, /* bitsize */
- TRUE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_dont, /* complain_on_overflow */
- ppc_elf_unhandled_reloc, /* special_function */
- "R_PPC_PLTREL32", /* name */
- FALSE, /* partial_inplace */
- 0, /* src_mask */
- 0, /* dst_mask */
- TRUE), /* pcrel_offset */
+ HOW (R_PPC_PLTREL32, 2, 32, 0, 0, TRUE, dont,
+ ppc_elf_unhandled_reloc),
/* Like R_PPC_ADDR16_LO, but referring to the PLT table entry for
the symbol. */
- HOWTO (R_PPC_PLT16_LO, /* type */
- 0, /* rightshift */
- 1, /* size (0 = byte, 1 = short, 2 = long) */
- 16, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_dont, /* complain_on_overflow */
- ppc_elf_unhandled_reloc, /* special_function */
- "R_PPC_PLT16_LO", /* name */
- FALSE, /* partial_inplace */
- 0, /* src_mask */
- 0xffff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ HOW (R_PPC_PLT16_LO, 1, 16, 0xffff, 0, FALSE, dont,
+ ppc_elf_unhandled_reloc),
/* Like R_PPC_ADDR16_HI, but referring to the PLT table entry for
the symbol. */
- HOWTO (R_PPC_PLT16_HI, /* type */
- 16, /* rightshift */
- 1, /* size (0 = byte, 1 = short, 2 = long) */
- 16, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_dont, /* complain_on_overflow */
- ppc_elf_unhandled_reloc, /* special_function */
- "R_PPC_PLT16_HI", /* name */
- FALSE, /* partial_inplace */
- 0, /* src_mask */
- 0xffff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ HOW (R_PPC_PLT16_HI, 1, 16, 0xffff, 16, FALSE, dont,
+ ppc_elf_unhandled_reloc),
/* Like R_PPC_ADDR16_HA, but referring to the PLT table entry for
the symbol. */
- HOWTO (R_PPC_PLT16_HA, /* type */
- 16, /* rightshift */
- 1, /* size (0 = byte, 1 = short, 2 = long) */
- 16, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_dont, /* complain_on_overflow */
- ppc_elf_unhandled_reloc, /* special_function */
- "R_PPC_PLT16_HA", /* name */
- FALSE, /* partial_inplace */
- 0, /* src_mask */
- 0xffff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ HOW (R_PPC_PLT16_HA, 1, 16, 0xffff, 16, FALSE, dont,
+ ppc_elf_unhandled_reloc),
/* A sign-extended 16 bit value relative to _SDA_BASE_, for use with
small data items. */
- HOWTO (R_PPC_SDAREL16, /* type */
- 0, /* rightshift */
- 1, /* size (0 = byte, 1 = short, 2 = long) */
- 16, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_signed, /* complain_on_overflow */
- ppc_elf_unhandled_reloc, /* special_function */
- "R_PPC_SDAREL16", /* name */
- FALSE, /* partial_inplace */
- 0, /* src_mask */
- 0xffff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ HOW (R_PPC_SDAREL16, 1, 16, 0xffff, 0, FALSE, signed,
+ ppc_elf_unhandled_reloc),
/* 16-bit section relative relocation. */
- HOWTO (R_PPC_SECTOFF, /* type */
- 0, /* rightshift */
- 1, /* size (0 = byte, 1 = short, 2 = long) */
- 16, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_signed, /* complain_on_overflow */
- ppc_elf_unhandled_reloc, /* special_function */
- "R_PPC_SECTOFF", /* name */
- FALSE, /* partial_inplace */
- 0, /* src_mask */
- 0xffff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ HOW (R_PPC_SECTOFF, 1, 16, 0xffff, 0, FALSE, signed,
+ ppc_elf_unhandled_reloc),
/* 16-bit lower half section relative relocation. */
- HOWTO (R_PPC_SECTOFF_LO, /* type */
- 0, /* rightshift */
- 1, /* size (0 = byte, 1 = short, 2 = long) */
- 16, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_dont, /* complain_on_overflow */
- ppc_elf_unhandled_reloc, /* special_function */
- "R_PPC_SECTOFF_LO", /* name */
- FALSE, /* partial_inplace */
- 0, /* src_mask */
- 0xffff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ HOW (R_PPC_SECTOFF_LO, 1, 16, 0xffff, 0, FALSE, dont,
+ ppc_elf_unhandled_reloc),
/* 16-bit upper half section relative relocation. */
- HOWTO (R_PPC_SECTOFF_HI, /* type */
- 16, /* rightshift */
- 1, /* size (0 = byte, 1 = short, 2 = long) */
- 16, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_dont, /* complain_on_overflow */
- ppc_elf_unhandled_reloc, /* special_function */
- "R_PPC_SECTOFF_HI", /* name */
- FALSE, /* partial_inplace */
- 0, /* src_mask */
- 0xffff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ HOW (R_PPC_SECTOFF_HI, 1, 16, 0xffff, 16, FALSE, dont,
+ ppc_elf_unhandled_reloc),
/* 16-bit upper half adjusted section relative relocation. */
- HOWTO (R_PPC_SECTOFF_HA, /* type */
- 16, /* rightshift */
- 1, /* size (0 = byte, 1 = short, 2 = long) */
- 16, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_dont, /* complain_on_overflow */
- ppc_elf_unhandled_reloc, /* special_function */
- "R_PPC_SECTOFF_HA", /* name */
- FALSE, /* partial_inplace */
- 0, /* src_mask */
- 0xffff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ HOW (R_PPC_SECTOFF_HA, 1, 16, 0xffff, 16, FALSE, dont,
+ ppc_elf_unhandled_reloc),
/* Marker relocs for TLS. */
- HOWTO (R_PPC_TLS,
- 0, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
- 32, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_dont, /* complain_on_overflow */
- bfd_elf_generic_reloc, /* special_function */
- "R_PPC_TLS", /* name */
- FALSE, /* partial_inplace */
- 0, /* src_mask */
- 0, /* dst_mask */
- FALSE), /* pcrel_offset */
-
- HOWTO (R_PPC_TLSGD,
- 0, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
- 32, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_dont, /* complain_on_overflow */
- bfd_elf_generic_reloc, /* special_function */
- "R_PPC_TLSGD", /* name */
- FALSE, /* partial_inplace */
- 0, /* src_mask */
- 0, /* dst_mask */
- FALSE), /* pcrel_offset */
-
- HOWTO (R_PPC_TLSLD,
- 0, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
- 32, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_dont, /* complain_on_overflow */
- bfd_elf_generic_reloc, /* special_function */
- "R_PPC_TLSLD", /* name */
- FALSE, /* partial_inplace */
- 0, /* src_mask */
- 0, /* dst_mask */
- FALSE), /* pcrel_offset */
+ HOW (R_PPC_TLS, 2, 32, 0, 0, FALSE, dont,
+ bfd_elf_generic_reloc),
+
+ HOW (R_PPC_TLSGD, 2, 32, 0, 0, FALSE, dont,
+ bfd_elf_generic_reloc),
+
+ HOW (R_PPC_TLSLD, 2, 32, 0, 0, FALSE, dont,
+ bfd_elf_generic_reloc),
/* Marker relocs on inline plt call instructions. */
- HOWTO (R_PPC_PLTSEQ,
- 0, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
- 32, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_dont, /* complain_on_overflow */
- bfd_elf_generic_reloc, /* special_function */
- "R_PPC_PLTSEQ", /* name */
- FALSE, /* partial_inplace */
- 0, /* src_mask */
- 0, /* dst_mask */
- FALSE), /* pcrel_offset */
-
- HOWTO (R_PPC_PLTCALL,
- 0, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
- 32, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_dont, /* complain_on_overflow */
- bfd_elf_generic_reloc, /* special_function */
- "R_PPC_PLTCALL", /* name */
- FALSE, /* partial_inplace */
- 0, /* src_mask */
- 0, /* dst_mask */
- FALSE), /* pcrel_offset */
+ HOW (R_PPC_PLTSEQ, 2, 32, 0, 0, FALSE, dont,
+ bfd_elf_generic_reloc),
+
+ HOW (R_PPC_PLTCALL, 2, 32, 0, 0, FALSE, dont,
+ bfd_elf_generic_reloc),
/* Computes the load module index of the load module that contains the
definition of its TLS sym. */
- HOWTO (R_PPC_DTPMOD32,
- 0, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
- 32, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_dont, /* complain_on_overflow */
- ppc_elf_unhandled_reloc, /* special_function */
- "R_PPC_DTPMOD32", /* name */
- FALSE, /* partial_inplace */
- 0, /* src_mask */
- 0xffffffff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ HOW (R_PPC_DTPMOD32, 2, 32, 0xffffffff, 0, FALSE, dont,
+ ppc_elf_unhandled_reloc),
/* Computes a dtv-relative displacement, the difference between the value
of sym+add and the base address of the thread-local storage block that
contains the definition of sym, minus 0x8000. */
- HOWTO (R_PPC_DTPREL32,
- 0, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
- 32, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_dont, /* complain_on_overflow */
- ppc_elf_unhandled_reloc, /* special_function */
- "R_PPC_DTPREL32", /* name */
- FALSE, /* partial_inplace */
- 0, /* src_mask */
- 0xffffffff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ HOW (R_PPC_DTPREL32, 2, 32, 0xffffffff, 0, FALSE, dont,
+ ppc_elf_unhandled_reloc),
/* A 16 bit dtprel reloc. */
- HOWTO (R_PPC_DTPREL16,
- 0, /* rightshift */
- 1, /* size (0 = byte, 1 = short, 2 = long) */
- 16, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_signed, /* complain_on_overflow */
- ppc_elf_unhandled_reloc, /* special_function */
- "R_PPC_DTPREL16", /* name */
- FALSE, /* partial_inplace */
- 0, /* src_mask */
- 0xffff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ HOW (R_PPC_DTPREL16, 1, 16, 0xffff, 0, FALSE, signed,
+ ppc_elf_unhandled_reloc),
/* Like DTPREL16, but no overflow. */
- HOWTO (R_PPC_DTPREL16_LO,
- 0, /* rightshift */
- 1, /* size (0 = byte, 1 = short, 2 = long) */
- 16, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_dont, /* complain_on_overflow */
- ppc_elf_unhandled_reloc, /* special_function */
- "R_PPC_DTPREL16_LO", /* name */
- FALSE, /* partial_inplace */
- 0, /* src_mask */
- 0xffff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ HOW (R_PPC_DTPREL16_LO, 1, 16, 0xffff, 0, FALSE, dont,
+ ppc_elf_unhandled_reloc),
/* Like DTPREL16_LO, but next higher group of 16 bits. */
- HOWTO (R_PPC_DTPREL16_HI,
- 16, /* rightshift */
- 1, /* size (0 = byte, 1 = short, 2 = long) */
- 16, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_dont, /* complain_on_overflow */
- ppc_elf_unhandled_reloc, /* special_function */
- "R_PPC_DTPREL16_HI", /* name */
- FALSE, /* partial_inplace */
- 0, /* src_mask */
- 0xffff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ HOW (R_PPC_DTPREL16_HI, 1, 16, 0xffff, 16, FALSE, dont,
+ ppc_elf_unhandled_reloc),
/* Like DTPREL16_HI, but adjust for low 16 bits. */
- HOWTO (R_PPC_DTPREL16_HA,
- 16, /* rightshift */
- 1, /* size (0 = byte, 1 = short, 2 = long) */
- 16, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_dont, /* complain_on_overflow */
- ppc_elf_unhandled_reloc, /* special_function */
- "R_PPC_DTPREL16_HA", /* name */
- FALSE, /* partial_inplace */
- 0, /* src_mask */
- 0xffff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ HOW (R_PPC_DTPREL16_HA, 1, 16, 0xffff, 16, FALSE, dont,
+ ppc_elf_unhandled_reloc),
/* Computes a tp-relative displacement, the difference between the value of
sym+add and the value of the thread pointer (r13). */
- HOWTO (R_PPC_TPREL32,
- 0, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
- 32, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_dont, /* complain_on_overflow */
- ppc_elf_unhandled_reloc, /* special_function */
- "R_PPC_TPREL32", /* name */
- FALSE, /* partial_inplace */
- 0, /* src_mask */
- 0xffffffff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ HOW (R_PPC_TPREL32, 2, 32, 0xffffffff, 0, FALSE, dont,
+ ppc_elf_unhandled_reloc),
/* A 16 bit tprel reloc. */
- HOWTO (R_PPC_TPREL16,
- 0, /* rightshift */
- 1, /* size (0 = byte, 1 = short, 2 = long) */
- 16, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_signed, /* complain_on_overflow */
- ppc_elf_unhandled_reloc, /* special_function */
- "R_PPC_TPREL16", /* name */
- FALSE, /* partial_inplace */
- 0, /* src_mask */
- 0xffff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ HOW (R_PPC_TPREL16, 1, 16, 0xffff, 0, FALSE, signed,
+ ppc_elf_unhandled_reloc),
/* Like TPREL16, but no overflow. */
- HOWTO (R_PPC_TPREL16_LO,
- 0, /* rightshift */
- 1, /* size (0 = byte, 1 = short, 2 = long) */
- 16, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_dont, /* complain_on_overflow */
- ppc_elf_unhandled_reloc, /* special_function */
- "R_PPC_TPREL16_LO", /* name */
- FALSE, /* partial_inplace */
- 0, /* src_mask */
- 0xffff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ HOW (R_PPC_TPREL16_LO, 1, 16, 0xffff, 0, FALSE, dont,
+ ppc_elf_unhandled_reloc),
/* Like TPREL16_LO, but next higher group of 16 bits. */
- HOWTO (R_PPC_TPREL16_HI,
- 16, /* rightshift */
- 1, /* size (0 = byte, 1 = short, 2 = long) */
- 16, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_dont, /* complain_on_overflow */
- ppc_elf_unhandled_reloc, /* special_function */
- "R_PPC_TPREL16_HI", /* name */
- FALSE, /* partial_inplace */
- 0, /* src_mask */
- 0xffff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ HOW (R_PPC_TPREL16_HI, 1, 16, 0xffff, 16, FALSE, dont,
+ ppc_elf_unhandled_reloc),
/* Like TPREL16_HI, but adjust for low 16 bits. */
- HOWTO (R_PPC_TPREL16_HA,
- 16, /* rightshift */
- 1, /* size (0 = byte, 1 = short, 2 = long) */
- 16, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_dont, /* complain_on_overflow */
- ppc_elf_unhandled_reloc, /* special_function */
- "R_PPC_TPREL16_HA", /* name */
- FALSE, /* partial_inplace */
- 0, /* src_mask */
- 0xffff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ HOW (R_PPC_TPREL16_HA, 1, 16, 0xffff, 16, FALSE, dont,
+ ppc_elf_unhandled_reloc),
/* Allocates two contiguous entries in the GOT to hold a tls_index structure,
with values (sym+add)@dtpmod and (sym+add)@dtprel, and computes the offset
to the first entry. */
- HOWTO (R_PPC_GOT_TLSGD16,
- 0, /* rightshift */
- 1, /* size (0 = byte, 1 = short, 2 = long) */
- 16, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_signed, /* complain_on_overflow */
- ppc_elf_unhandled_reloc, /* special_function */
- "R_PPC_GOT_TLSGD16", /* name */
- FALSE, /* partial_inplace */
- 0, /* src_mask */
- 0xffff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ HOW (R_PPC_GOT_TLSGD16, 1, 16, 0xffff, 0, FALSE, signed,
+ ppc_elf_unhandled_reloc),
/* Like GOT_TLSGD16, but no overflow. */
- HOWTO (R_PPC_GOT_TLSGD16_LO,
- 0, /* rightshift */
- 1, /* size (0 = byte, 1 = short, 2 = long) */
- 16, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_dont, /* complain_on_overflow */
- ppc_elf_unhandled_reloc, /* special_function */
- "R_PPC_GOT_TLSGD16_LO", /* name */
- FALSE, /* partial_inplace */
- 0, /* src_mask */
- 0xffff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ HOW (R_PPC_GOT_TLSGD16_LO, 1, 16, 0xffff, 0, FALSE, dont,
+ ppc_elf_unhandled_reloc),
/* Like GOT_TLSGD16_LO, but next higher group of 16 bits. */
- HOWTO (R_PPC_GOT_TLSGD16_HI,
- 16, /* rightshift */
- 1, /* size (0 = byte, 1 = short, 2 = long) */
- 16, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_dont, /* complain_on_overflow */
- ppc_elf_unhandled_reloc, /* special_function */
- "R_PPC_GOT_TLSGD16_HI", /* name */
- FALSE, /* partial_inplace */
- 0, /* src_mask */
- 0xffff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ HOW (R_PPC_GOT_TLSGD16_HI, 1, 16, 0xffff, 16, FALSE, dont,
+ ppc_elf_unhandled_reloc),
/* Like GOT_TLSGD16_HI, but adjust for low 16 bits. */
- HOWTO (R_PPC_GOT_TLSGD16_HA,
- 16, /* rightshift */
- 1, /* size (0 = byte, 1 = short, 2 = long) */
- 16, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_dont, /* complain_on_overflow */
- ppc_elf_unhandled_reloc, /* special_function */
- "R_PPC_GOT_TLSGD16_HA", /* name */
- FALSE, /* partial_inplace */
- 0, /* src_mask */
- 0xffff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ HOW (R_PPC_GOT_TLSGD16_HA, 1, 16, 0xffff, 16, FALSE, dont,
+ ppc_elf_unhandled_reloc),
/* Allocates two contiguous entries in the GOT to hold a tls_index structure,
with values (sym+add)@dtpmod and zero, and computes the offset to the
first entry. */
- HOWTO (R_PPC_GOT_TLSLD16,
- 0, /* rightshift */
- 1, /* size (0 = byte, 1 = short, 2 = long) */
- 16, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_signed, /* complain_on_overflow */
- ppc_elf_unhandled_reloc, /* special_function */
- "R_PPC_GOT_TLSLD16", /* name */
- FALSE, /* partial_inplace */
- 0, /* src_mask */
- 0xffff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ HOW (R_PPC_GOT_TLSLD16, 1, 16, 0xffff, 0, FALSE, signed,
+ ppc_elf_unhandled_reloc),
/* Like GOT_TLSLD16, but no overflow. */
- HOWTO (R_PPC_GOT_TLSLD16_LO,
- 0, /* rightshift */
- 1, /* size (0 = byte, 1 = short, 2 = long) */
- 16, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_dont, /* complain_on_overflow */
- ppc_elf_unhandled_reloc, /* special_function */
- "R_PPC_GOT_TLSLD16_LO", /* name */
- FALSE, /* partial_inplace */
- 0, /* src_mask */
- 0xffff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ HOW (R_PPC_GOT_TLSLD16_LO, 1, 16, 0xffff, 0, FALSE, dont,
+ ppc_elf_unhandled_reloc),
/* Like GOT_TLSLD16_LO, but next higher group of 16 bits. */
- HOWTO (R_PPC_GOT_TLSLD16_HI,
- 16, /* rightshift */
- 1, /* size (0 = byte, 1 = short, 2 = long) */
- 16, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_dont, /* complain_on_overflow */
- ppc_elf_unhandled_reloc, /* special_function */
- "R_PPC_GOT_TLSLD16_HI", /* name */
- FALSE, /* partial_inplace */
- 0, /* src_mask */
- 0xffff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ HOW (R_PPC_GOT_TLSLD16_HI, 1, 16, 0xffff, 16, FALSE, dont,
+ ppc_elf_unhandled_reloc),
/* Like GOT_TLSLD16_HI, but adjust for low 16 bits. */
- HOWTO (R_PPC_GOT_TLSLD16_HA,
- 16, /* rightshift */
- 1, /* size (0 = byte, 1 = short, 2 = long) */
- 16, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_dont, /* complain_on_overflow */
- ppc_elf_unhandled_reloc, /* special_function */
- "R_PPC_GOT_TLSLD16_HA", /* name */
- FALSE, /* partial_inplace */
- 0, /* src_mask */
- 0xffff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ HOW (R_PPC_GOT_TLSLD16_HA, 1, 16, 0xffff, 16, FALSE, dont,
+ ppc_elf_unhandled_reloc),
/* Allocates an entry in the GOT with value (sym+add)@dtprel, and computes
the offset to the entry. */
- HOWTO (R_PPC_GOT_DTPREL16,
- 0, /* rightshift */
- 1, /* size (0 = byte, 1 = short, 2 = long) */
- 16, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_signed, /* complain_on_overflow */
- ppc_elf_unhandled_reloc, /* special_function */
- "R_PPC_GOT_DTPREL16", /* name */
- FALSE, /* partial_inplace */
- 0, /* src_mask */
- 0xffff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ HOW (R_PPC_GOT_DTPREL16, 1, 16, 0xffff, 0, FALSE, signed,
+ ppc_elf_unhandled_reloc),
/* Like GOT_DTPREL16, but no overflow. */
- HOWTO (R_PPC_GOT_DTPREL16_LO,
- 0, /* rightshift */
- 1, /* size (0 = byte, 1 = short, 2 = long) */
- 16, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_dont, /* complain_on_overflow */
- ppc_elf_unhandled_reloc, /* special_function */
- "R_PPC_GOT_DTPREL16_LO", /* name */
- FALSE, /* partial_inplace */
- 0, /* src_mask */
- 0xffff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ HOW (R_PPC_GOT_DTPREL16_LO, 1, 16, 0xffff, 0, FALSE, dont,
+ ppc_elf_unhandled_reloc),
/* Like GOT_DTPREL16_LO, but next higher group of 16 bits. */
- HOWTO (R_PPC_GOT_DTPREL16_HI,
- 16, /* rightshift */
- 1, /* size (0 = byte, 1 = short, 2 = long) */
- 16, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_dont, /* complain_on_overflow */
- ppc_elf_unhandled_reloc, /* special_function */
- "R_PPC_GOT_DTPREL16_HI", /* name */
- FALSE, /* partial_inplace */
- 0, /* src_mask */
- 0xffff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ HOW (R_PPC_GOT_DTPREL16_HI, 1, 16, 0xffff, 16, FALSE, dont,
+ ppc_elf_unhandled_reloc),
/* Like GOT_DTPREL16_HI, but adjust for low 16 bits. */
- HOWTO (R_PPC_GOT_DTPREL16_HA,
- 16, /* rightshift */
- 1, /* size (0 = byte, 1 = short, 2 = long) */
- 16, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_dont, /* complain_on_overflow */
- ppc_elf_unhandled_reloc, /* special_function */
- "R_PPC_GOT_DTPREL16_HA", /* name */
- FALSE, /* partial_inplace */
- 0, /* src_mask */
- 0xffff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ HOW (R_PPC_GOT_DTPREL16_HA, 1, 16, 0xffff, 16, FALSE, dont,
+ ppc_elf_unhandled_reloc),
/* Allocates an entry in the GOT with value (sym+add)@tprel, and computes the
offset to the entry. */
- HOWTO (R_PPC_GOT_TPREL16,
- 0, /* rightshift */
- 1, /* size (0 = byte, 1 = short, 2 = long) */
- 16, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_signed, /* complain_on_overflow */
- ppc_elf_unhandled_reloc, /* special_function */
- "R_PPC_GOT_TPREL16", /* name */
- FALSE, /* partial_inplace */
- 0, /* src_mask */
- 0xffff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ HOW (R_PPC_GOT_TPREL16, 1, 16, 0xffff, 0, FALSE, signed,
+ ppc_elf_unhandled_reloc),
/* Like GOT_TPREL16, but no overflow. */
- HOWTO (R_PPC_GOT_TPREL16_LO,
- 0, /* rightshift */
- 1, /* size (0 = byte, 1 = short, 2 = long) */
- 16, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_dont, /* complain_on_overflow */
- ppc_elf_unhandled_reloc, /* special_function */
- "R_PPC_GOT_TPREL16_LO", /* name */
- FALSE, /* partial_inplace */
- 0, /* src_mask */
- 0xffff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ HOW (R_PPC_GOT_TPREL16_LO, 1, 16, 0xffff, 0, FALSE, dont,
+ ppc_elf_unhandled_reloc),
/* Like GOT_TPREL16_LO, but next higher group of 16 bits. */
- HOWTO (R_PPC_GOT_TPREL16_HI,
- 16, /* rightshift */
- 1, /* size (0 = byte, 1 = short, 2 = long) */
- 16, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_dont, /* complain_on_overflow */
- ppc_elf_unhandled_reloc, /* special_function */
- "R_PPC_GOT_TPREL16_HI", /* name */
- FALSE, /* partial_inplace */
- 0, /* src_mask */
- 0xffff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ HOW (R_PPC_GOT_TPREL16_HI, 1, 16, 0xffff, 16, FALSE, dont,
+ ppc_elf_unhandled_reloc),
/* Like GOT_TPREL16_HI, but adjust for low 16 bits. */
- HOWTO (R_PPC_GOT_TPREL16_HA,
- 16, /* rightshift */
- 1, /* size (0 = byte, 1 = short, 2 = long) */
- 16, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_dont, /* complain_on_overflow */
- ppc_elf_unhandled_reloc, /* special_function */
- "R_PPC_GOT_TPREL16_HA", /* name */
- FALSE, /* partial_inplace */
- 0, /* src_mask */
- 0xffff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ HOW (R_PPC_GOT_TPREL16_HA, 1, 16, 0xffff, 16, FALSE, dont,
+ ppc_elf_unhandled_reloc),
/* The remaining relocs are from the Embedded ELF ABI, and are not
in the SVR4 ELF ABI. */
/* 32 bit value resulting from the addend minus the symbol. */
- HOWTO (R_PPC_EMB_NADDR32, /* type */
- 0, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
- 32, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_dont, /* complain_on_overflow */
- ppc_elf_unhandled_reloc, /* special_function */
- "R_PPC_EMB_NADDR32", /* name */
- FALSE, /* partial_inplace */
- 0, /* src_mask */
- 0xffffffff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ HOW (R_PPC_EMB_NADDR32, 2, 32, 0xffffffff, 0, FALSE, dont,
+ ppc_elf_unhandled_reloc),
/* 16 bit value resulting from the addend minus the symbol. */
- HOWTO (R_PPC_EMB_NADDR16, /* type */
- 0, /* rightshift */
- 1, /* size (0 = byte, 1 = short, 2 = long) */
- 16, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_signed, /* complain_on_overflow */
- ppc_elf_unhandled_reloc, /* special_function */
- "R_PPC_EMB_NADDR16", /* name */
- FALSE, /* partial_inplace */
- 0, /* src_mask */
- 0xffff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ HOW (R_PPC_EMB_NADDR16, 1, 16, 0xffff, 0, FALSE, signed,
+ ppc_elf_unhandled_reloc),
/* 16 bit value resulting from the addend minus the symbol. */
- HOWTO (R_PPC_EMB_NADDR16_LO, /* type */
- 0, /* rightshift */
- 1, /* size (0 = byte, 1 = short, 2 = long) */
- 16, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_dont,/* complain_on_overflow */
- ppc_elf_unhandled_reloc, /* special_function */
- "R_PPC_EMB_ADDR16_LO", /* name */
- FALSE, /* partial_inplace */
- 0, /* src_mask */
- 0xffff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ HOW (R_PPC_EMB_NADDR16_LO, 1, 16, 0xffff, 0, FALSE, dont,
+ ppc_elf_unhandled_reloc),
/* The high order 16 bits of the addend minus the symbol. */
- HOWTO (R_PPC_EMB_NADDR16_HI, /* type */
- 16, /* rightshift */
- 1, /* size (0 = byte, 1 = short, 2 = long) */
- 16, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_dont, /* complain_on_overflow */
- ppc_elf_unhandled_reloc, /* special_function */
- "R_PPC_EMB_NADDR16_HI", /* name */
- FALSE, /* partial_inplace */
- 0, /* src_mask */
- 0xffff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ HOW (R_PPC_EMB_NADDR16_HI, 1, 16, 0xffff, 16, FALSE, dont,
+ ppc_elf_unhandled_reloc),
/* The high order 16 bits of the result of the addend minus the address,
plus 1 if the contents of the low 16 bits, treated as a signed number,
is negative. */
- HOWTO (R_PPC_EMB_NADDR16_HA, /* type */
- 16, /* rightshift */
- 1, /* size (0 = byte, 1 = short, 2 = long) */
- 16, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_dont, /* complain_on_overflow */
- ppc_elf_unhandled_reloc, /* special_function */
- "R_PPC_EMB_NADDR16_HA", /* name */
- FALSE, /* partial_inplace */
- 0, /* src_mask */
- 0xffff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ HOW (R_PPC_EMB_NADDR16_HA, 1, 16, 0xffff, 16, FALSE, dont,
+ ppc_elf_unhandled_reloc),
/* 16 bit value resulting from allocating a 4 byte word to hold an
address in the .sdata section, and returning the offset from
_SDA_BASE_ for that relocation. */
- HOWTO (R_PPC_EMB_SDAI16, /* type */
- 0, /* rightshift */
- 1, /* size (0 = byte, 1 = short, 2 = long) */
- 16, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_signed, /* complain_on_overflow */
- ppc_elf_unhandled_reloc, /* special_function */
- "R_PPC_EMB_SDAI16", /* name */
- FALSE, /* partial_inplace */
- 0, /* src_mask */
- 0xffff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ HOW (R_PPC_EMB_SDAI16, 1, 16, 0xffff, 0, FALSE, signed,
+ ppc_elf_unhandled_reloc),
/* 16 bit value resulting from allocating a 4 byte word to hold an
address in the .sdata2 section, and returning the offset from
_SDA2_BASE_ for that relocation. */
- HOWTO (R_PPC_EMB_SDA2I16, /* type */
- 0, /* rightshift */
- 1, /* size (0 = byte, 1 = short, 2 = long) */
- 16, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_signed, /* complain_on_overflow */
- ppc_elf_unhandled_reloc, /* special_function */
- "R_PPC_EMB_SDA2I16", /* name */
- FALSE, /* partial_inplace */
- 0, /* src_mask */
- 0xffff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ HOW (R_PPC_EMB_SDA2I16, 1, 16, 0xffff, 0, FALSE, signed,
+ ppc_elf_unhandled_reloc),
/* A sign-extended 16 bit value relative to _SDA2_BASE_, for use with
small data items. */
- HOWTO (R_PPC_EMB_SDA2REL, /* type */
- 0, /* rightshift */
- 1, /* size (0 = byte, 1 = short, 2 = long) */
- 16, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_signed, /* complain_on_overflow */
- ppc_elf_unhandled_reloc, /* special_function */
- "R_PPC_EMB_SDA2REL", /* name */
- FALSE, /* partial_inplace */
- 0, /* src_mask */
- 0xffff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ HOW (R_PPC_EMB_SDA2REL, 1, 16, 0xffff, 0, FALSE, signed,
+ ppc_elf_unhandled_reloc),
/* Relocate against either _SDA_BASE_ or _SDA2_BASE_, filling in the 16 bit
signed offset from the appropriate base, and filling in the register
field with the appropriate register (0, 2, or 13). */
- HOWTO (R_PPC_EMB_SDA21, /* type */
- 0, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
- 16, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_signed, /* complain_on_overflow */
- ppc_elf_unhandled_reloc, /* special_function */
- "R_PPC_EMB_SDA21", /* name */
- FALSE, /* partial_inplace */
- 0, /* src_mask */
- 0xffff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ HOW (R_PPC_EMB_SDA21, 2, 16, 0xffff, 0, FALSE, signed,
+ ppc_elf_unhandled_reloc),
/* Relocation not handled: R_PPC_EMB_MRKREF */
/* Relocation not handled: R_PPC_EMB_RELSEC16 */
/* PC relative relocation against either _SDA_BASE_ or _SDA2_BASE_, filling
in the 16 bit signed offset from the appropriate base, and filling in the
register field with the appropriate register (0, 2, or 13). */
- HOWTO (R_PPC_EMB_RELSDA, /* type */
- 0, /* rightshift */
- 1, /* size (0 = byte, 1 = short, 2 = long) */
- 16, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_signed, /* complain_on_overflow */
- ppc_elf_unhandled_reloc, /* special_function */
- "R_PPC_EMB_RELSDA", /* name */
- FALSE, /* partial_inplace */
- 0, /* src_mask */
- 0xffff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ HOW (R_PPC_EMB_RELSDA, 1, 16, 0xffff, 0, FALSE, signed,
+ ppc_elf_unhandled_reloc),
/* A relative 8 bit branch. */
- HOWTO (R_PPC_VLE_REL8, /* type */
- 1, /* rightshift */
- 1, /* size (0 = byte, 1 = short, 2 = long) */
- 8, /* bitsize */
- TRUE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_signed, /* complain_on_overflow */
- bfd_elf_generic_reloc, /* special_function */
- "R_PPC_VLE_REL8", /* name */
- FALSE, /* partial_inplace */
- 0, /* src_mask */
- 0xff, /* dst_mask */
- TRUE), /* pcrel_offset */
+ HOW (R_PPC_VLE_REL8, 1, 8, 0xff, 1, TRUE, signed,
+ bfd_elf_generic_reloc),
/* A relative 15 bit branch. */
- HOWTO (R_PPC_VLE_REL15, /* type */
- 1, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
- 15, /* bitsize */
- TRUE, /* pc_relative */
- 1, /* bitpos */
- complain_overflow_signed, /* complain_on_overflow */
- bfd_elf_generic_reloc, /* special_function */
- "R_PPC_VLE_REL15", /* name */
- FALSE, /* partial_inplace */
- 0, /* src_mask */
- 0xfffe, /* dst_mask */
- TRUE), /* pcrel_offset */
+ HOW (R_PPC_VLE_REL15, 2, 16, 0xfffe, 0, TRUE, signed,
+ bfd_elf_generic_reloc),
/* A relative 24 bit branch. */
- HOWTO (R_PPC_VLE_REL24, /* type */
- 1, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
- 24, /* bitsize */
- TRUE, /* pc_relative */
- 1, /* bitpos */
- complain_overflow_signed, /* complain_on_overflow */
- bfd_elf_generic_reloc, /* special_function */
- "R_PPC_VLE_REL24", /* name */
- FALSE, /* partial_inplace */
- 0, /* src_mask */
- 0x1fffffe, /* dst_mask */
- TRUE), /* pcrel_offset */
+ HOW (R_PPC_VLE_REL24, 2, 25, 0x1fffffe, 0, TRUE, signed,
+ bfd_elf_generic_reloc),
/* The 16 LSBS in split16a format. */
- HOWTO (R_PPC_VLE_LO16A, /* type */
- 0, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
- 16, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_dont, /* complain_on_overflow */
- ppc_elf_unhandled_reloc, /* special_function */
- "R_PPC_VLE_LO16A", /* name */
- FALSE, /* partial_inplace */
- 0, /* src_mask */
- 0x1f07ff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ HOW (R_PPC_VLE_LO16A, 2, 16, 0x1f07ff, 0, FALSE, dont,
+ ppc_elf_unhandled_reloc),
/* The 16 LSBS in split16d format. */
- HOWTO (R_PPC_VLE_LO16D, /* type */
- 0, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
- 16, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_dont, /* complain_on_overflow */
- ppc_elf_unhandled_reloc, /* special_function */
- "R_PPC_VLE_LO16D", /* name */
- FALSE, /* partial_inplace */
- 0, /* src_mask */
- 0x3e007ff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ HOW (R_PPC_VLE_LO16D, 2, 16, 0x3e007ff, 0, FALSE, dont,
+ ppc_elf_unhandled_reloc),
/* Bits 16-31 split16a format. */
- HOWTO (R_PPC_VLE_HI16A, /* type */
- 16, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
- 16, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_dont, /* complain_on_overflow */
- ppc_elf_unhandled_reloc, /* special_function */
- "R_PPC_VLE_HI16A", /* name */
- FALSE, /* partial_inplace */
- 0, /* src_mask */
- 0x1f07ff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ HOW (R_PPC_VLE_HI16A, 2, 16, 0x1f07ff, 16, FALSE, dont,
+ ppc_elf_unhandled_reloc),
/* Bits 16-31 split16d format. */
- HOWTO (R_PPC_VLE_HI16D, /* type */
- 16, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
- 16, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_dont, /* complain_on_overflow */
- ppc_elf_unhandled_reloc, /* special_function */
- "R_PPC_VLE_HI16D", /* name */
- FALSE, /* partial_inplace */
- 0, /* src_mask */
- 0x3e007ff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ HOW (R_PPC_VLE_HI16D, 2, 16, 0x3e007ff, 16, FALSE, dont,
+ ppc_elf_unhandled_reloc),
/* Bits 16-31 (High Adjusted) in split16a format. */
- HOWTO (R_PPC_VLE_HA16A, /* type */
- 16, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
- 16, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_dont, /* complain_on_overflow */
- ppc_elf_unhandled_reloc, /* special_function */
- "R_PPC_VLE_HA16A", /* name */
- FALSE, /* partial_inplace */
- 0, /* src_mask */
- 0x1f07ff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ HOW (R_PPC_VLE_HA16A, 2, 16, 0x1f07ff, 16, FALSE, dont,
+ ppc_elf_unhandled_reloc),
/* Bits 16-31 (High Adjusted) in split16d format. */
- HOWTO (R_PPC_VLE_HA16D, /* type */
- 16, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
- 16, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_dont, /* complain_on_overflow */
- ppc_elf_unhandled_reloc, /* special_function */
- "R_PPC_VLE_HA16D", /* name */
- FALSE, /* partial_inplace */
- 0, /* src_mask */
- 0x3e007ff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ HOW (R_PPC_VLE_HA16D, 2, 16, 0x3e007ff, 16, FALSE, dont,
+ ppc_elf_unhandled_reloc),
/* This reloc is like R_PPC_EMB_SDA21 but only applies to e_add16i
instructions. If the register base is 0 then the linker changes
the e_add16i to an e_li instruction. */
- HOWTO (R_PPC_VLE_SDA21, /* type */
- 0, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
- 16, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_signed, /* complain_on_overflow */
- ppc_elf_unhandled_reloc, /* special_function */
- "R_PPC_VLE_SDA21", /* name */
- FALSE, /* partial_inplace */
- 0, /* src_mask */
- 0xffff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ HOW (R_PPC_VLE_SDA21, 2, 16, 0xffff, 0, FALSE, signed,
+ ppc_elf_unhandled_reloc),
/* Like R_PPC_VLE_SDA21 but ignore overflow. */
- HOWTO (R_PPC_VLE_SDA21_LO, /* type */
- 0, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
- 16, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_dont, /* complain_on_overflow */
- ppc_elf_unhandled_reloc, /* special_function */
- "R_PPC_VLE_SDA21_LO", /* name */
- FALSE, /* partial_inplace */
- 0, /* src_mask */
- 0xffff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ HOW (R_PPC_VLE_SDA21_LO, 2, 16, 0xffff, 0, FALSE, dont,
+ ppc_elf_unhandled_reloc),
/* The 16 LSBS relative to _SDA_BASE_ in split16a format. */
- HOWTO (R_PPC_VLE_SDAREL_LO16A,/* type */
- 0, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
- 16, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_dont, /* complain_on_overflow */
- ppc_elf_unhandled_reloc, /* special_function */
- "R_PPC_VLE_SDAREL_LO16A", /* name */
- FALSE, /* partial_inplace */
- 0, /* src_mask */
- 0x1f07ff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ HOW (R_PPC_VLE_SDAREL_LO16A, 2, 16, 0x1f07ff, 0, FALSE, dont,
+ ppc_elf_unhandled_reloc),
/* The 16 LSBS relative to _SDA_BASE_ in split16d format. */
- HOWTO (R_PPC_VLE_SDAREL_LO16D, /* type */
- 0, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
- 16, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_dont, /* complain_on_overflow */
- ppc_elf_unhandled_reloc, /* special_function */
- "R_PPC_VLE_SDAREL_LO16D", /* name */
- FALSE, /* partial_inplace */
- 0, /* src_mask */
- 0x3e007ff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ HOW (R_PPC_VLE_SDAREL_LO16D, 2, 16, 0x3e007ff, 0, FALSE, dont,
+ ppc_elf_unhandled_reloc),
/* Bits 16-31 relative to _SDA_BASE_ in split16a format. */
- HOWTO (R_PPC_VLE_SDAREL_HI16A, /* type */
- 16, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
- 16, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_dont, /* complain_on_overflow */
- ppc_elf_unhandled_reloc, /* special_function */
- "R_PPC_VLE_SDAREL_HI16A", /* name */
- FALSE, /* partial_inplace */
- 0, /* src_mask */
- 0x1f07ff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ HOW (R_PPC_VLE_SDAREL_HI16A, 2, 16, 0x1f07ff, 16, FALSE, dont,
+ ppc_elf_unhandled_reloc),
/* Bits 16-31 relative to _SDA_BASE_ in split16d format. */
- HOWTO (R_PPC_VLE_SDAREL_HI16D, /* type */
- 16, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
- 16, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_dont, /* complain_on_overflow */
- ppc_elf_unhandled_reloc, /* special_function */
- "R_PPC_VLE_SDAREL_HI16D", /* name */
- FALSE, /* partial_inplace */
- 0, /* src_mask */
- 0x3e007ff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ HOW (R_PPC_VLE_SDAREL_HI16D, 2, 16, 0x3e007ff, 16, FALSE, dont,
+ ppc_elf_unhandled_reloc),
/* Bits 16-31 (HA) relative to _SDA_BASE split16a format. */
- HOWTO (R_PPC_VLE_SDAREL_HA16A, /* type */
- 16, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
- 16, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_dont, /* complain_on_overflow */
- ppc_elf_unhandled_reloc, /* special_function */
- "R_PPC_VLE_SDAREL_HA16A", /* name */
- FALSE, /* partial_inplace */
- 0, /* src_mask */
- 0x1f07ff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ HOW (R_PPC_VLE_SDAREL_HA16A, 2, 16, 0x1f07ff, 16, FALSE, dont,
+ ppc_elf_unhandled_reloc),
/* Bits 16-31 (HA) relative to _SDA_BASE split16d format. */
- HOWTO (R_PPC_VLE_SDAREL_HA16D, /* type */
- 16, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
- 16, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_dont, /* complain_on_overflow */
- ppc_elf_unhandled_reloc, /* special_function */
- "R_PPC_VLE_SDAREL_HA16D", /* name */
- FALSE, /* partial_inplace */
- 0, /* src_mask */
- 0x3e007ff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ HOW (R_PPC_VLE_SDAREL_HA16D, 2, 16, 0x3e007ff, 16, FALSE, dont,
+ ppc_elf_unhandled_reloc),
/* e_li split20 format. */
- HOWTO (R_PPC_VLE_ADDR20, /* type */
- 16, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
- 20, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_dont, /* complain_on_overflow */
- bfd_elf_generic_reloc, /* special_function */
- "R_PPC_VLE_ADDR20", /* name */
- FALSE, /* partial_inplace */
- 0, /* src_mask */
- 0x1f07ff, /* dst_mask */
- FALSE), /* pcrel_offset */
-
- HOWTO (R_PPC_IRELATIVE, /* type */
- 0, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
- 32, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_dont, /* complain_on_overflow */
- ppc_elf_unhandled_reloc, /* special_function */
- "R_PPC_IRELATIVE", /* name */
- FALSE, /* partial_inplace */
- 0, /* src_mask */
- 0xffffffff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ HOW (R_PPC_VLE_ADDR20, 2, 20, 0x1f7fff, 0, FALSE, dont,
+ ppc_elf_unhandled_reloc),
+
+ HOW (R_PPC_IRELATIVE, 2, 32, 0xffffffff, 0, FALSE, dont,
+ ppc_elf_unhandled_reloc),
/* A 16 bit relative relocation. */
- HOWTO (R_PPC_REL16, /* type */
- 0, /* rightshift */
- 1, /* size (0 = byte, 1 = short, 2 = long) */
- 16, /* bitsize */
- TRUE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_signed, /* complain_on_overflow */
- bfd_elf_generic_reloc, /* special_function */
- "R_PPC_REL16", /* name */
- FALSE, /* partial_inplace */
- 0, /* src_mask */
- 0xffff, /* dst_mask */
- TRUE), /* pcrel_offset */
+ HOW (R_PPC_REL16, 1, 16, 0xffff, 0, TRUE, signed,
+ bfd_elf_generic_reloc),
/* A 16 bit relative relocation without overflow. */
- HOWTO (R_PPC_REL16_LO, /* type */
- 0, /* rightshift */
- 1, /* size (0 = byte, 1 = short, 2 = long) */
- 16, /* bitsize */
- TRUE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_dont,/* complain_on_overflow */
- bfd_elf_generic_reloc, /* special_function */
- "R_PPC_REL16_LO", /* name */
- FALSE, /* partial_inplace */
- 0, /* src_mask */
- 0xffff, /* dst_mask */
- TRUE), /* pcrel_offset */
+ HOW (R_PPC_REL16_LO, 1, 16, 0xffff, 0, TRUE, dont,
+ bfd_elf_generic_reloc),
/* The high order 16 bits of a relative address. */
- HOWTO (R_PPC_REL16_HI, /* type */
- 16, /* rightshift */
- 1, /* size (0 = byte, 1 = short, 2 = long) */
- 16, /* bitsize */
- TRUE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_dont, /* complain_on_overflow */
- bfd_elf_generic_reloc, /* special_function */
- "R_PPC_REL16_HI", /* name */
- FALSE, /* partial_inplace */
- 0, /* src_mask */
- 0xffff, /* dst_mask */
- TRUE), /* pcrel_offset */
+ HOW (R_PPC_REL16_HI, 1, 16, 0xffff, 16, TRUE, dont,
+ bfd_elf_generic_reloc),
/* The high order 16 bits of a relative address, plus 1 if the contents of
the low 16 bits, treated as a signed number, is negative. */
- HOWTO (R_PPC_REL16_HA, /* type */
- 16, /* rightshift */
- 1, /* size (0 = byte, 1 = short, 2 = long) */
- 16, /* bitsize */
- TRUE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_dont, /* complain_on_overflow */
- ppc_elf_addr16_ha_reloc, /* special_function */
- "R_PPC_REL16_HA", /* name */
- FALSE, /* partial_inplace */
- 0, /* src_mask */
- 0xffff, /* dst_mask */
- TRUE), /* pcrel_offset */
+ HOW (R_PPC_REL16_HA, 1, 16, 0xffff, 16, TRUE, dont,
+ ppc_elf_addr16_ha_reloc),
/* Like R_PPC_REL16_HA but for split field in addpcis. */
- HOWTO (R_PPC_REL16DX_HA, /* type */
- 16, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
- 16, /* bitsize */
- TRUE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_signed, /* complain_on_overflow */
- ppc_elf_addr16_ha_reloc, /* special_function */
- "R_PPC_REL16DX_HA", /* name */
- FALSE, /* partial_inplace */
- 0, /* src_mask */
- 0x1fffc1, /* dst_mask */
- TRUE), /* pcrel_offset */
+ HOW (R_PPC_REL16DX_HA, 2, 16, 0x1fffc1, 16, TRUE, signed,
+ ppc_elf_addr16_ha_reloc),
/* A split-field reloc for addpcis, non-relative (gas internal use only). */
- HOWTO (R_PPC_16DX_HA, /* type */
- 16, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
- 16, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_signed, /* complain_on_overflow */
- ppc_elf_addr16_ha_reloc, /* special_function */
- "R_PPC_16DX_HA", /* name */
- FALSE, /* partial_inplace */
- 0, /* src_mask */
- 0x1fffc1, /* dst_mask */
- FALSE), /* pcrel_offset */
+ HOW (R_PPC_16DX_HA, 2, 16, 0x1fffc1, 16, FALSE, signed,
+ ppc_elf_addr16_ha_reloc),
/* GNU extension to record C++ vtable hierarchy. */
- HOWTO (R_PPC_GNU_VTINHERIT, /* type */
- 0, /* rightshift */
- 0, /* size (0 = byte, 1 = short, 2 = long) */
- 0, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_dont, /* complain_on_overflow */
- NULL, /* special_function */
- "R_PPC_GNU_VTINHERIT", /* name */
- FALSE, /* partial_inplace */
- 0, /* src_mask */
- 0, /* dst_mask */
- FALSE), /* pcrel_offset */
+ HOW (R_PPC_GNU_VTINHERIT, 0, 0, 0, 0, FALSE, dont,
+ NULL),
/* GNU extension to record C++ vtable member usage. */
- HOWTO (R_PPC_GNU_VTENTRY, /* type */
- 0, /* rightshift */
- 0, /* size (0 = byte, 1 = short, 2 = long) */
- 0, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_dont, /* complain_on_overflow */
- NULL, /* special_function */
- "R_PPC_GNU_VTENTRY", /* name */
- FALSE, /* partial_inplace */
- 0, /* src_mask */
- 0, /* dst_mask */
- FALSE), /* pcrel_offset */
+ HOW (R_PPC_GNU_VTENTRY, 0, 0, 0, 0, FALSE, dont,
+ NULL),
/* Phony reloc to handle AIX style TOC entries. */
- HOWTO (R_PPC_TOC16, /* type */
- 0, /* rightshift */
- 1, /* size (0 = byte, 1 = short, 2 = long) */
- 16, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_signed, /* complain_on_overflow */
- ppc_elf_unhandled_reloc, /* special_function */
- "R_PPC_TOC16", /* name */
- FALSE, /* partial_inplace */
- 0, /* src_mask */
- 0xffff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ HOW (R_PPC_TOC16, 1, 16, 0xffff, 0, FALSE, signed,
+ ppc_elf_unhandled_reloc),
};
\f
/* Initialize the ppc_elf_howto_table, so that linear accesses can be done. */
if (mach == 0)
{
s = bfd_get_section_by_name (abfd, APUINFO_SECTION_NAME);
- if (s != NULL && bfd_malloc_and_get_section (abfd, s, &contents))
+ if (s != NULL
+ && s->size >= 24
+ && bfd_malloc_and_get_section (abfd, s, &contents))
{
unsigned int apuinfo_size = bfd_get_32 (abfd, contents + 4);
unsigned int i;
case NT_PRPSINFO:
{
- char data[128];
+ char data[128] ATTRIBUTE_NONSTRING;
va_list ap;
va_start (ap, note_type);
memset (data, 0, sizeof (data));
strncpy (data + 32, va_arg (ap, const char *), 16);
+#if GCC_VERSION == 8000 || GCC_VERSION == 8001
+ DIAGNOSTIC_PUSH;
+ /* GCC 8.0 and 8.1 warn about 80 equals destination size with
+ -Wstringop-truncation:
+ https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85643
+ */
+ DIAGNOSTIC_IGNORE_STRINGOP_TRUNCATION;
+#endif
strncpy (data + 48, va_arg (ap, const char *), 80);
+#if GCC_VERSION == 8000 || GCC_VERSION == 8001
+ DIAGNOSTIC_POP;
+#endif
va_end (ap);
return elfcore_write_note (abfd, buf, bufsiz,
"CORE", note_type, data, sizeof (data));
/* Finally we can generate the output section. */
static void
-ppc_elf_final_write_processing (bfd *abfd, bfd_boolean linker ATTRIBUTE_UNUSED)
+ppc_final_write_processing (bfd *abfd)
{
bfd_byte *buffer;
asection *asec;
apuinfo_list_finish ();
}
+
+static bfd_boolean
+ppc_elf_final_write_processing (bfd *abfd)
+{
+ ppc_final_write_processing (abfd);
+ return _bfd_elf_final_write_processing (abfd);
+}
\f
static bfd_boolean
is_nonpic_glink_stub (bfd *abfd, asection *glink, bfd_vma off)
of the other TLS bits are set. tls_optimize clears bits when
optimizing to indicate the corresponding GOT entry type is not
needed. If set, TLS_TLS is never cleared. tls_optimize may also
- set TLS_TPRELGD when a GD reloc turns into a TPREL one. We use a
- separate flag rather than setting TPREL just for convenience in
- distinguishing the two cases.
+ set TLS_GDIE when a GD reloc turns into an IE one.
These flags are also kept for local symbols. */
#define TLS_TLS 1 /* Any TLS reloc. */
#define TLS_GD 2 /* GD reloc. */
#define TLS_TPREL 8 /* TPREL reloc, => IE. */
#define TLS_DTPREL 16 /* DTPREL reloc, => LD. */
#define TLS_MARK 32 /* __tls_get_addr call marked. */
-#define TLS_TPRELGD 64 /* TPREL reloc resulting from GD->IE. */
+#define TLS_GDIE 64 /* GOT TPREL reloc resulting from GD->IE. */
unsigned char tls_mask;
/* The above field is also used to mark function symbols. In which
*valp = sym->st_size;
}
- if (ELF_ST_TYPE (sym->st_info) == STT_GNU_IFUNC
- && (abfd->flags & DYNAMIC) == 0
- && bfd_get_flavour (info->output_bfd) == bfd_target_elf_flavour)
- elf_tdata (info->output_bfd)->has_gnu_symbols |= elf_gnu_symbol_ifunc;
-
return TRUE;
}
\f
/* This relocation describes which C++ vtable entries are actually
used. Record for later use during GC. */
case R_PPC_GNU_VTENTRY:
- BFD_ASSERT (h != NULL);
- if (h != NULL
- && !bfd_elf_gc_record_vtentry (abfd, sec, h, rel->r_addend))
+ if (!bfd_elf_gc_record_vtentry (abfd, sec, h, rel->r_addend))
return FALSE;
break;
\f
/* Warn for conflicting Tag_GNU_Power_ABI_FP attributes between IBFD
and OBFD, and merge non-conflicting ones. */
-void
+bfd_boolean
_bfd_elf_ppc_merge_fp_attributes (bfd *ibfd, struct bfd_link_info *info)
{
bfd *obfd = info->output_bfd;
obj_attribute *in_attr, *in_attrs;
obj_attribute *out_attr, *out_attrs;
+ bfd_boolean ret = TRUE;
in_attrs = elf_known_obj_attributes (ibfd)[OBJ_ATTR_GNU];
out_attrs = elf_known_obj_attributes (obfd)[OBJ_ATTR_GNU];
{
int in_fp = in_attr->i & 3;
int out_fp = out_attr->i & 3;
+ static bfd *last_fp, *last_ld;
if (in_fp == 0)
;
else if (out_fp == 0)
{
- out_attr->type = 1;
+ out_attr->type = ATTR_TYPE_FLAG_INT_VAL;
out_attr->i ^= in_fp;
+ last_fp = ibfd;
}
else if (out_fp != 2 && in_fp == 2)
- _bfd_error_handler
- /* xgettext:c-format */
- (_("warning: %pB uses hard float, %pB uses soft float"), obfd, ibfd);
+ {
+ _bfd_error_handler
+ /* xgettext:c-format */
+ (_("%pB uses hard float, %pB uses soft float"),
+ last_fp, ibfd);
+ ret = FALSE;
+ }
else if (out_fp == 2 && in_fp != 2)
- _bfd_error_handler
- /* xgettext:c-format */
- (_("warning: %pB uses hard float, %pB uses soft float"), ibfd, obfd);
+ {
+ _bfd_error_handler
+ /* xgettext:c-format */
+ (_("%pB uses hard float, %pB uses soft float"),
+ ibfd, last_fp);
+ ret = FALSE;
+ }
else if (out_fp == 1 && in_fp == 3)
- _bfd_error_handler
- /* xgettext:c-format */
- (_("warning: %pB uses double-precision hard float, "
- "%pB uses single-precision hard float"), obfd, ibfd);
+ {
+ _bfd_error_handler
+ /* xgettext:c-format */
+ (_("%pB uses double-precision hard float, "
+ "%pB uses single-precision hard float"), last_fp, ibfd);
+ ret = FALSE;
+ }
else if (out_fp == 3 && in_fp == 1)
- _bfd_error_handler
- /* xgettext:c-format */
- (_("warning: %pB uses double-precision hard float, "
- "%pB uses single-precision hard float"), ibfd, obfd);
+ {
+ _bfd_error_handler
+ /* xgettext:c-format */
+ (_("%pB uses double-precision hard float, "
+ "%pB uses single-precision hard float"), ibfd, last_fp);
+ ret = FALSE;
+ }
in_fp = in_attr->i & 0xc;
out_fp = out_attr->i & 0xc;
;
else if (out_fp == 0)
{
- out_attr->type = 1;
+ out_attr->type = ATTR_TYPE_FLAG_INT_VAL;
out_attr->i ^= in_fp;
+ last_ld = ibfd;
}
else if (out_fp != 2 * 4 && in_fp == 2 * 4)
- _bfd_error_handler
- /* xgettext:c-format */
- (_("warning: %pB uses 64-bit long double, "
- "%pB uses 128-bit long double"), ibfd, obfd);
+ {
+ _bfd_error_handler
+ /* xgettext:c-format */
+ (_("%pB uses 64-bit long double, "
+ "%pB uses 128-bit long double"), ibfd, last_ld);
+ ret = FALSE;
+ }
else if (in_fp != 2 * 4 && out_fp == 2 * 4)
- _bfd_error_handler
- /* xgettext:c-format */
- (_("warning: %pB uses 64-bit long double, "
- "%pB uses 128-bit long double"), obfd, ibfd);
+ {
+ _bfd_error_handler
+ /* xgettext:c-format */
+ (_("%pB uses 64-bit long double, "
+ "%pB uses 128-bit long double"), last_ld, ibfd);
+ ret = FALSE;
+ }
else if (out_fp == 1 * 4 && in_fp == 3 * 4)
- _bfd_error_handler
- /* xgettext:c-format */
- (_("warning: %pB uses IBM long double, "
- "%pB uses IEEE long double"), ibfd, obfd);
+ {
+ _bfd_error_handler
+ /* xgettext:c-format */
+ (_("%pB uses IBM long double, "
+ "%pB uses IEEE long double"), last_ld, ibfd);
+ ret = FALSE;
+ }
else if (out_fp == 3 * 4 && in_fp == 1 * 4)
- _bfd_error_handler
- /* xgettext:c-format */
- (_("warning: %pB uses IBM long double, "
- "%pB uses IEEE long double"), obfd, ibfd);
+ {
+ _bfd_error_handler
+ /* xgettext:c-format */
+ (_("%pB uses IBM long double, "
+ "%pB uses IEEE long double"), ibfd, last_ld);
+ ret = FALSE;
+ }
+ }
+
+ if (!ret)
+ {
+ out_attr->type = ATTR_TYPE_FLAG_INT_VAL | ATTR_TYPE_FLAG_ERROR;
+ bfd_set_error (bfd_error_bad_value);
}
+ return ret;
}
/* Merge object attributes from IBFD into OBFD. Warn if
bfd *obfd;
obj_attribute *in_attr, *in_attrs;
obj_attribute *out_attr, *out_attrs;
+ bfd_boolean ret;
- _bfd_elf_ppc_merge_fp_attributes (ibfd, info);
+ if (!_bfd_elf_ppc_merge_fp_attributes (ibfd, info))
+ return FALSE;
obfd = info->output_bfd;
in_attrs = elf_known_obj_attributes (ibfd)[OBJ_ATTR_GNU];
merge non-conflicting ones. */
in_attr = &in_attrs[Tag_GNU_Power_ABI_Vector];
out_attr = &out_attrs[Tag_GNU_Power_ABI_Vector];
+ ret = TRUE;
if (in_attr->i != out_attr->i)
{
int in_vec = in_attr->i & 3;
int out_vec = out_attr->i & 3;
+ static bfd *last_vec;
if (in_vec == 0)
;
else if (out_vec == 0)
{
- out_attr->type = 1;
+ out_attr->type = ATTR_TYPE_FLAG_INT_VAL;
out_attr->i = in_vec;
+ last_vec = ibfd;
}
/* For now, allow generic to transition to AltiVec or SPE
without a warning. If GCC marked files with their stack
;
else if (out_vec == 1)
{
- out_attr->type = 1;
+ out_attr->type = ATTR_TYPE_FLAG_INT_VAL;
out_attr->i = in_vec;
+ last_vec = ibfd;
}
else if (out_vec < in_vec)
- _bfd_error_handler
- /* xgettext:c-format */
- (_("warning: %pB uses AltiVec vector ABI, %pB uses SPE vector ABI"),
- obfd, ibfd);
+ {
+ _bfd_error_handler
+ /* xgettext:c-format */
+ (_("%pB uses AltiVec vector ABI, %pB uses SPE vector ABI"),
+ last_vec, ibfd);
+ out_attr->type = ATTR_TYPE_FLAG_INT_VAL | ATTR_TYPE_FLAG_ERROR;
+ ret = FALSE;
+ }
else if (out_vec > in_vec)
- _bfd_error_handler
- /* xgettext:c-format */
- (_("warning: %pB uses AltiVec vector ABI, %pB uses SPE vector ABI"),
- ibfd, obfd);
+ {
+ _bfd_error_handler
+ /* xgettext:c-format */
+ (_("%pB uses AltiVec vector ABI, %pB uses SPE vector ABI"),
+ ibfd, last_vec);
+ out_attr->type = ATTR_TYPE_FLAG_INT_VAL | ATTR_TYPE_FLAG_ERROR;
+ ret = FALSE;
+ }
}
/* Check for conflicting Tag_GNU_Power_ABI_Struct_Return attributes
{
int in_struct = in_attr->i & 3;
int out_struct = out_attr->i & 3;
+ static bfd *last_struct;
if (in_struct == 0 || in_struct == 3)
;
else if (out_struct == 0)
{
- out_attr->type = 1;
+ out_attr->type = ATTR_TYPE_FLAG_INT_VAL;
out_attr->i = in_struct;
+ last_struct = ibfd;
}
else if (out_struct < in_struct)
- _bfd_error_handler
- /* xgettext:c-format */
- (_("warning: %pB uses r3/r4 for small structure returns, "
- "%pB uses memory"), obfd, ibfd);
+ {
+ _bfd_error_handler
+ /* xgettext:c-format */
+ (_("%pB uses r3/r4 for small structure returns, "
+ "%pB uses memory"), last_struct, ibfd);
+ out_attr->type = ATTR_TYPE_FLAG_INT_VAL | ATTR_TYPE_FLAG_ERROR;
+ ret = FALSE;
+ }
else if (out_struct > in_struct)
- _bfd_error_handler
- /* xgettext:c-format */
- (_("warning: %pB uses r3/r4 for small structure returns, "
- "%pB uses memory"), ibfd, obfd);
+ {
+ _bfd_error_handler
+ /* xgettext:c-format */
+ (_("%pB uses r3/r4 for small structure returns, "
+ "%pB uses memory"), ibfd, last_struct);
+ out_attr->type = ATTR_TYPE_FLAG_INT_VAL | ATTR_TYPE_FLAG_ERROR;
+ ret = FALSE;
+ }
+ }
+ if (!ret)
+ {
+ bfd_set_error (bfd_error_bad_value);
+ return FALSE;
}
/* Merge Tag_compatibility attributes and any common GNU ones. */
- _bfd_elf_merge_object_attributes (ibfd, info);
-
- return TRUE;
+ return _bfd_elf_merge_object_attributes (ibfd, info);
}
/* Merge backend specific data from an object file to the output
split16_format_type split16_format,
bfd_boolean fixup)
{
- unsigned int insn, opcode, top5;
+ unsigned int insn, opcode;
insn = bfd_get_32 (input_bfd, loc);
- opcode = insn & 0xfc00f800;
+ opcode = insn & E_OPCODE_MASK;
if (opcode == E_OR2I_INSN
|| opcode == E_AND2I_DOT_INSN
|| opcode == E_OR2IS_INSN
input_bfd, input_section, offset, opcode);
}
}
- top5 = value & 0xf800;
- top5 = top5 << (split16_format == split16a_type ? 5 : 10);
- insn &= (split16_format == split16a_type ? ~0x1f07ff : ~0x3e007ff);
- insn |= top5;
+ if (split16_format == split16a_type)
+ {
+ insn &= ~((0xf800 << 5) | 0x7ff);
+ insn |= (value & 0xf800) << 5;
+ if ((insn & E_LI_MASK) == E_LI_INSN)
+ {
+ /* Hack for e_li. Extend sign. */
+ insn &= ~(0xf0000 >> 5);
+ insn |= (-(value & 0x8000) & 0xf0000) >> 5;
+ }
+ }
+ else
+ {
+ insn &= ~((0xf800 << 10) | 0x7ff);
+ insn |= (value & 0xf800) << 10;
+ }
insn |= value & 0x7ff;
bfd_put_32 (input_bfd, insn, loc);
}
tls_set = 0;
else
/* GD -> IE */
- tls_set = TLS_TLS | TLS_TPRELGD;
+ tls_set = TLS_TLS | TLS_GDIE;
tls_clear = TLS_GD;
break;
&& !readonly_dynrelocs (h))
{
h->pointer_equality_needed = 0;
- /* If we haven't seen a branch reloc then we don't need
- a plt entry. */
- if (!h->needs_plt)
+ /* If we haven't seen a branch reloc and the symbol
+ isn't an ifunc then we don't need a plt entry. */
+ if (!h->needs_plt && h->type != STT_GNU_IFUNC)
h->plt.plist = NULL;
}
else if (!bfd_link_pic (info))
need = 0;
if ((tls_mask & TLS_GD) != 0)
need += 8;
- if ((tls_mask & (TLS_TPREL | TLS_TPRELGD)) != 0)
+ if ((tls_mask & (TLS_TPREL | TLS_GDIE)) != 0)
need += 4;
if ((tls_mask & TLS_DTPREL) != 0)
need += 4;
condition as that for IE, but ld.so needs to differentiate
LD and GD entries. */
if (known && (tls_mask & TLS_TLS) != 0
- && (tls_mask & (TLS_TPREL | TLS_TPRELGD)) != 0)
+ && (tls_mask & (TLS_TPREL | TLS_GDIE)) != 0)
need -= 4;
return need * sizeof (Elf32_External_Rela) / 4;
}
{
if (tsec != NULL)
;
- else if (isym->st_shndx == SHN_UNDEF)
- tsec = bfd_und_section_ptr;
else if (isym->st_shndx == SHN_ABS)
tsec = bfd_abs_section_ptr;
- else if (isym->st_shndx == SHN_COMMON)
- tsec = bfd_com_section_ptr;
+ else
+ continue;
toff = isym->st_value;
sym_type = ELF_ST_TYPE (isym->st_info);
if (tsec == isec)
continue;
+ /* toff is used for the symbol index when the symbol is
+ undefined and we're doing a relocatable link, so we can't
+ support addends. It would be possible to do so by
+ putting the addend in one_branch_fixup but addends on
+ branches are rare so it hardly seems worth supporting. */
+ if (bfd_link_relocatable (link_info)
+ && tsec == bfd_und_section_ptr
+ && r_type != R_PPC_PLTREL24
+ && irel->r_addend != 0)
+ continue;
+
/* There probably isn't any reason to handle symbols in
SEC_MERGE sections; SEC_MERGE doesn't seem a likely
attribute for a code section, and we are only looking at
a section symbol should not include the addend; Such an
access is presumed to be an offset from "sym"; The
location of interest is just "sym". */
- if (sym_type == STT_SECTION)
+ if (sym_type == STT_SECTION
+ && r_type != R_PPC_PLTREL24)
toff += irel->r_addend;
toff
elf_section_data (tsec)->sec_info,
toff);
- if (sym_type != STT_SECTION)
+ if (sym_type != STT_SECTION
+ && r_type != R_PPC_PLTREL24)
toff += irel->r_addend;
}
/* PLTREL24 addends are special. */
roff = irel->r_offset;
+ /* Avoid creating a lot of unnecessary fixups when
+ relocatable if the output section size is such that a
+ fixup can be created at final link.
+ The max_branch_offset adjustment allows for some number
+ of other fixups being needed at final link. */
+ if (bfd_link_relocatable (link_info)
+ && (isec->output_section->rawsize - (isec->output_offset + roff)
+ < max_branch_offset - (max_branch_offset >> 4)))
+ continue;
+
/* If the branch is in range, no need to do anything. */
if (tsec != bfd_und_section_ptr
&& (!bfd_link_relocatable (link_info)
(bfd_link_relocatable (info)) ? " (relocatable)" : "");
#endif
+ if (!is_ppc_elf (input_bfd))
+ {
+ bfd_set_error (bfd_error_wrong_format);
+ return FALSE;
+ }
+
got2 = bfd_get_section_by_name (input_bfd, ".got2");
/* Initialize howto table if not already done. */
howto = ppc_elf_howto_table[r_type];
_bfd_clear_contents (howto, input_bfd, input_section,
- contents + rel->r_offset);
+ contents, rel->r_offset);
wrel->r_offset = rel->r_offset;
wrel->r_info = 0;
wrel->r_addend = 0;
case R_PPC_GOT_TLSGD16_HI:
case R_PPC_GOT_TLSGD16_HA:
- tls_gd = TLS_TPRELGD;
+ tls_gd = TLS_GDIE;
if ((tls_mask & TLS_TLS) != 0 && (tls_mask & TLS_GD) == 0)
goto tls_gdld_hi;
break;
case R_PPC_GOT_TLSGD16:
case R_PPC_GOT_TLSGD16_LO:
- tls_gd = TLS_TPRELGD;
+ tls_gd = TLS_GDIE;
if ((tls_mask & TLS_TLS) != 0 && (tls_mask & TLS_GD) == 0)
goto tls_ldgd_opt;
break;
break;
}
- if ((tls_mask & TLS_TPRELGD) != 0)
+ if ((tls_mask & TLS_GDIE) != 0)
{
/* IE */
r_type = R_PPC_NONE;
{
unsigned int tls_m = ((tls_mask & TLS_TLS) != 0
? tls_mask & (TLS_LD | TLS_GD | TLS_DTPREL
- | TLS_TPREL | TLS_TPRELGD)
+ | TLS_TPREL | TLS_GDIE)
: 0);
if (offp == &htab->tlsld_got.offset)
tls_ty = TLS_TLS | TLS_DTPREL;
tls_m &= ~TLS_DTPREL;
}
- else if ((tls_m & (TLS_TPREL | TLS_TPRELGD)) != 0)
+ else if ((tls_m & (TLS_TPREL | TLS_GDIE)) != 0)
{
tls_ty = TLS_TLS | TLS_TPREL;
tls_m = 0;
outrel.r_offset += (input_section->output_section->vma
+ input_section->output_offset);
+ /* Optimize unaligned reloc use. */
+ if ((r_type == R_PPC_ADDR32 && (outrel.r_offset & 3) != 0)
+ || (r_type == R_PPC_UADDR32 && (outrel.r_offset & 3) == 0))
+ r_type ^= R_PPC_ADDR32 ^ R_PPC_UADDR32;
+ if ((r_type == R_PPC_ADDR16 && (outrel.r_offset & 1) != 0)
+ || (r_type == R_PPC_UADDR16 && (outrel.r_offset & 1) == 0))
+ r_type ^= R_PPC_ADDR16 ^ R_PPC_UADDR16;
+
if (skip)
memset (&outrel, 0, sizeof outrel);
else if (!SYMBOL_REFERENCES_LOCAL (info, h))
but ld.so expects buggy relocs.
FIXME: Why not always use a zero index? */
osec = sec->output_section;
- indx = elf_section_data (osec)->dynindx;
- if (indx == 0)
+ if ((osec->flags & SEC_THREAD_LOCAL) != 0)
+ {
+ osec = htab->elf.tls_sec;
+ indx = 0;
+ }
+ else
{
- osec = htab->elf.text_index_section;
indx = elf_section_data (osec)->dynindx;
+ if (indx == 0)
+ {
+ osec = htab->elf.text_index_section;
+ indx = elf_section_data (osec)->dynindx;
+ }
+ BFD_ASSERT (indx != 0);
}
- BFD_ASSERT (indx != 0);
-#ifdef DEBUG
- if (indx == 0)
- printf ("indx=%ld section=%s flags=%08x name=%s\n",
- indx, osec->name, osec->flags,
- h->root.root.string);
-#endif
+
+ /* ld.so doesn't expect buggy TLS relocs.
+ Don't leave the symbol value in the
+ addend for them. */
+ if (IS_PPC_TLS_RELOC (r_type))
+ outrel.r_addend -= osec->vma;
}
outrel.r_info = ELF32_R_INFO (indx, r_type);
addend -= SYM_VAL (sda);
}
+ if (r_type == R_PPC_EMB_RELSDA)
+ break;
+
+ /* The PowerPC Embedded Application Binary Interface
+ version 1.0 insanely chose to specify R_PPC_EMB_SDA21
+ operating on a 24-bit field at r_offset. GNU as and
+ GNU ld have always assumed R_PPC_EMB_SDA21 operates on
+ a 32-bit bit insn at r_offset. Cope with object file
+ producers that possibly comply with the EABI in
+ generating an odd r_offset for big-endian objects. */
+ if (r_type == R_PPC_EMB_SDA21)
+ rel->r_offset &= ~1;
+
insn = bfd_get_32 (input_bfd, contents + rel->r_offset);
if (reg == 0
&& (r_type == R_PPC_VLE_SDA21
goto overflow;
goto copy_reloc;
}
- else if (r_type == R_PPC_EMB_SDA21
- || r_type == R_PPC_VLE_SDA21
- || r_type == R_PPC_VLE_SDA21_LO)
- {
- /* Fill in register field. */
- insn = (insn & ~RA_REGISTER_MASK) | (reg << RA_REGISTER_SHIFT);
- }
+ /* Fill in register field. */
+ insn = (insn & ~RA_REGISTER_MASK) | (reg << RA_REGISTER_SHIFT);
bfd_put_32 (input_bfd, insn, contents + rel->r_offset);
}
break;
}
else if (htab->plt_type != PLT_NEW)
info->callbacks->einfo
- (_("%P: %H: %s relocation unsupported for bss-plt\n"),
+ (_("%X%P: %H: %s relocation unsupported for bss-plt\n"),
input_bfd, input_section, rel->r_offset,
howto->name);
break;
}
else if (htab->plt_type != PLT_NEW)
info->callbacks->einfo
- (_("%P: %H: %s relocation unsupported for bss-plt\n"),
+ (_("%X%P: %H: %s relocation unsupported for bss-plt\n"),
input_bfd, input_section, rel->r_offset,
howto->name);
break;
bfd_byte *loc;
bfd_vma val;
Elf_Internal_Rela rela;
+ unsigned char *p;
if (!get_sym_h (NULL, &sym, &sym_sec, NULL, &local_syms,
lplt - local_plt, ibfd))
loc = relplt->contents + (relplt->reloc_count++
* sizeof (Elf32_External_Rela));
bfd_elf32_swap_reloca_out (info->output_bfd, &rela, loc);
- }
- if ((ent->glink_offset & 1) == 0)
- {
- unsigned char *p = ((unsigned char *) htab->glink->contents
- + ent->glink_offset);
+ p = (unsigned char *) htab->glink->contents + ent->glink_offset;
write_glink_stub (NULL, ent, htab->elf.iplt, p, info);
- ent->glink_offset |= 1;
}
}
return ppc_elf_add_symbol_hook (abfd, info, sym, namep, flagsp, secp, valp);
}
-static void
-ppc_elf_vxworks_final_write_processing (bfd *abfd, bfd_boolean linker)
+static bfd_boolean
+ppc_elf_vxworks_final_write_processing (bfd *abfd)
{
- ppc_elf_final_write_processing (abfd, linker);
- elf_vxworks_final_write_processing (abfd, linker);
+ ppc_final_write_processing (abfd);
+ return elf_vxworks_final_write_processing (abfd);
}
/* On VxWorks, we emit relocations against _PROCEDURE_LINKAGE_TABLE_, so