/* Main header file for the bfd library -- portable access to object files.
- Copyright (C) 1990-2018 Free Software Foundation, Inc.
+ Copyright (C) 1990-2019 Free Software Foundation, Inc.
Contributed by Cygnus Support.
#include "ansidecl.h"
#include "symcat.h"
+#include "bfd_stdint.h"
+#include "diagnostics.h"
#include <stdarg.h>
#include <sys/stat.h>
/* A count of carsyms (canonical archive symbols). */
typedef unsigned long symindex;
-/* How to perform a relocation. */
-typedef const struct reloc_howto_struct reloc_howto_type;
-
#define BFD_NO_MORE_SYMBOLS ((symindex) ~0)
/* General purpose part of a symbol X;
void bfd_putl64 (bfd_uint64_t, void *);
void bfd_putb32 (bfd_vma, void *);
void bfd_putl32 (bfd_vma, void *);
+void bfd_putb24 (bfd_vma, void *);
+void bfd_putl24 (bfd_vma, void *);
void bfd_putb16 (bfd_vma, void *);
void bfd_putl16 (bfd_vma, void *);
extern bfd_boolean bfd_i386linux_size_dynamic_sections
(bfd *, struct bfd_link_info *);
-extern bfd_boolean bfd_m68klinux_size_dynamic_sections
- (bfd *, struct bfd_link_info *);
extern bfd_boolean bfd_sparclinux_size_dynamic_sections
(bfd *, struct bfd_link_info *);
extern bfd_boolean bfd_coff_set_symbol_class
(bfd *, struct bfd_symbol *, unsigned int);
-extern bfd_boolean bfd_m68k_coff_create_embedded_relocs
- (bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *, char **);
-
/* ARM VFP11 erratum workaround support. */
typedef enum
{
extern void bfd_elf32_aarch64_init_maps
(bfd *);
+/* Types of PLTs based on the level of security. This would be a
+ bit-mask to denote which of the combinations of security features
+ are enabled:
+ - No security feature PLTs
+ - PLTs with BTI instruction
+ - PLTs with PAC instruction
+*/
+typedef enum
+{
+ PLT_NORMAL = 0x0, /* Normal plts. */
+ PLT_BTI = 0x1, /* plts with bti. */
+ PLT_PAC = 0x2, /* plts with pointer authentication. */
+ PLT_BTI_PAC = PLT_BTI | PLT_PAC
+} aarch64_plt_type;
+
+/* To indicate if BTI is enabled with/without warning. */
+typedef enum
+{
+ BTI_NONE = 0, /* BTI is not enabled. */
+ BTI_WARN = 1, /* BTI is enabled with -z force-bti. */
+} aarch64_enable_bti_type;
+
+/* A structure to encompass all information coming from BTI or PAC
+ related command line options. This involves the "PLT_TYPE" to determine
+ which version of PLTs to pick and "BTI_TYPE" to determine if
+ BTI should be turned on with any warnings. */
+typedef struct
+{
+ aarch64_plt_type plt_type;
+ aarch64_enable_bti_type bti_type;
+} aarch64_bti_pac_info;
+
+/* An enum to define what kind of erratum fixes we should apply. This gives the
+ user a bit more control over the sequences we generate. */
+typedef enum
+{
+ ERRAT_NONE = (1 << 0), /* No erratum workarounds allowed. */
+ ERRAT_ADR = (1 << 1), /* Erratum workarounds using ADR allowed. */
+ ERRAT_ADRP = (1 << 2), /* Erratum workarounds using ADRP are allowed. */
+} erratum_84319_opts;
+
extern void bfd_elf64_aarch64_set_options
- (bfd *, struct bfd_link_info *, int, int, int, int, int, int);
+ (bfd *, struct bfd_link_info *, int, int, int, int, erratum_84319_opts, int,
+ aarch64_bti_pac_info);
extern void bfd_elf32_aarch64_set_options
- (bfd *, struct bfd_link_info *, int, int, int, int, int, int);
+ (bfd *, struct bfd_link_info *, int, int, int, int, erratum_84319_opts, int,
+ aarch64_bti_pac_info);
/* ELF AArch64 mapping symbol support. */
#define BFD_AARCH64_SPECIAL_SYM_TYPE_MAP (1 << 0)
/* MIPS ABI flags data access. For the disassembler. */
struct elf_internal_abiflags_v0;
extern struct elf_internal_abiflags_v0 *bfd_mips_elf_get_abiflags (bfd *);
+
+/* C-SKY functions. */
+extern bfd_boolean elf32_csky_build_stubs
+ (struct bfd_link_info *);
+extern bfd_boolean elf32_csky_size_stubs
+ (bfd *, bfd *, struct bfd_link_info *, bfd_signed_vma,
+ struct bfd_section *(*) (const char*, struct bfd_section*),
+ void (*) (void));
+extern void elf32_csky_next_input_section
+ (struct bfd_link_info *, struct bfd_section *);
+extern int elf32_csky_setup_section_lists
+ (bfd *, struct bfd_link_info *);
/* Extracted from init.c. */
-void bfd_init (void);
+unsigned int bfd_init (void);
+
+/* Value returned by bfd_init. */
+
+#define BFD_INIT_MAGIC (sizeof (struct bfd_section))
/* Extracted from opncls.c. */
/* Set to N to open the next N BFDs using an alternate id space. */
extern unsigned int bfd_use_reserved_id;
#define bfd_get_signed_16(abfd, ptr) \
BFD_SEND (abfd, bfd_getx_signed_16, (ptr))
+#define bfd_put_24(abfd, val, ptr) \
+ do \
+ if (bfd_big_endian (abfd)) \
+ bfd_putb24 ((val), (ptr)); \
+ else \
+ bfd_putl24 ((val), (ptr)); \
+ while (0)
+
+bfd_vma bfd_getb24 (const void *p);
+bfd_vma bfd_getl24 (const void *p);
+
+#define bfd_get_24(abfd, ptr) \
+ (bfd_big_endian (abfd) ? bfd_getb24 (ptr) : bfd_getl24 (ptr))
+
#define bfd_put_32(abfd, val, ptr) \
BFD_SEND (abfd, bfd_putx32, ((val),(ptr)))
#define bfd_put_signed_32 \
asection *bfd_make_section (bfd *, const char *name);
-int bfd_get_next_section_id (void);
-
bfd_boolean bfd_set_section_flags
(bfd *abfd, asection *sec, flagword flags);
#define bfd_mach_mips5 5
#define bfd_mach_mips_loongson_2e 3001
#define bfd_mach_mips_loongson_2f 3002
-#define bfd_mach_mips_loongson_3a 3003
+#define bfd_mach_mips_gs464 3003
+#define bfd_mach_mips_gs464e 3004
+#define bfd_mach_mips_gs264e 3005
#define bfd_mach_mips_sb1 12310201 /* octal 'SB', 01. */
#define bfd_mach_mips_octeon 6501
#define bfd_mach_mips_octeonp 6601
#define bfd_mach_iamcu (1 << 8)
#define bfd_mach_i386_iamcu (bfd_mach_i386_i386 | bfd_mach_iamcu)
#define bfd_mach_i386_iamcu_intel_syntax (bfd_mach_i386_iamcu | bfd_mach_i386_intel_syntax)
- bfd_arch_we32k, /* AT&T WE32xxx. */
- bfd_arch_i370, /* IBM 360/370 Mainframes. */
bfd_arch_romp, /* IBM ROMP PC/RT. */
bfd_arch_convex, /* Convex. */
- bfd_arch_m88k, /* Motorola 88xxx. */
bfd_arch_m98k, /* Motorola 98xxx. */
bfd_arch_pyramid, /* Pyramid Technology. */
bfd_arch_h8300, /* Renesas H8/300 (formerly Hitachi H8/300). */
#define bfd_mach_m6812s 2
bfd_arch_m9s12x, /* Freescale S12X. */
bfd_arch_m9s12xg, /* Freescale XGATE. */
+ bfd_arch_s12z, /* Freescale S12Z. */
+#define bfd_mach_s12z_default 0
bfd_arch_z8k, /* Zilog Z8000. */
#define bfd_mach_z8001 1
#define bfd_mach_z8002 2
- bfd_arch_h8500, /* Renesas H8/500 (formerly Hitachi H8/500). */
bfd_arch_sh, /* Renesas / SuperH SH (formerly Hitachi SH). */
#define bfd_mach_sh 1
#define bfd_mach_sh2 0x20
#define bfd_mach_sh4a 0x4a
#define bfd_mach_sh4a_nofpu 0x4b
#define bfd_mach_sh4al_dsp 0x4d
-#define bfd_mach_sh5 0x50
bfd_arch_alpha, /* Dec Alpha. */
#define bfd_mach_alpha_ev4 0x10
#define bfd_mach_alpha_ev5 0x20
#define bfd_mach_arm_ep9312 11
#define bfd_mach_arm_iWMMXt 12
#define bfd_mach_arm_iWMMXt2 13
+#define bfd_mach_arm_5TEJ 14
+#define bfd_mach_arm_6 15
+#define bfd_mach_arm_6KZ 16
+#define bfd_mach_arm_6T2 17
+#define bfd_mach_arm_6K 18
+#define bfd_mach_arm_7 19
+#define bfd_mach_arm_6M 20
+#define bfd_mach_arm_6SM 21
+#define bfd_mach_arm_7EM 22
+#define bfd_mach_arm_8 23
+#define bfd_mach_arm_8R 24
+#define bfd_mach_arm_8M_BASE 25
+#define bfd_mach_arm_8M_MAIN 26
+#define bfd_mach_arm_8_1M_MAIN 27
bfd_arch_nds32, /* Andes NDS32. */
#define bfd_mach_n1 1
#define bfd_mach_n1h 2
#define bfd_mach_n1h_v3 4
#define bfd_mach_n1h_v3m 5
bfd_arch_ns32k, /* National Semiconductors ns32000. */
- bfd_arch_w65, /* WDC 65816. */
bfd_arch_tic30, /* Texas Instruments TMS320C30. */
bfd_arch_tic4x, /* Texas Instruments TMS320C3X/4X. */
#define bfd_mach_tic3x 30
bfd_arch_iq2000, /* Vitesse IQ2000. */
#define bfd_mach_iq2000 1
#define bfd_mach_iq10 2
+ bfd_arch_bpf, /* Linux eBPF. */
+#define bfd_mach_bpf 1
bfd_arch_epiphany, /* Adapteva EPIPHANY. */
#define bfd_mach_epiphany16 1
#define bfd_mach_epiphany32 2
#define bfd_mach_rl78 0x75
bfd_arch_rx, /* Renesas RX. */
#define bfd_mach_rx 0x75
+#define bfd_mach_rx_v2 0x76
+#define bfd_mach_rx_v3 0x77
bfd_arch_s390, /* IBM s390. */
#define bfd_mach_s390_31 31
#define bfd_mach_s390_64 64
#define bfd_mach_wasm32 1
bfd_arch_pru, /* PRU. */
#define bfd_mach_pru 0
+ bfd_arch_nfp, /* Netronome Flow Processor */
+#define bfd_mach_nfp3200 0x3200
+#define bfd_mach_nfp6000 0x6000
+ bfd_arch_csky, /* C-SKY. */
+#define bfd_mach_ck_unknown 0
+#define bfd_mach_ck510 1
+#define bfd_mach_ck610 2
+#define bfd_mach_ck801 3
+#define bfd_mach_ck802 4
+#define bfd_mach_ck803 5
+#define bfd_mach_ck807 6
+#define bfd_mach_ck810 7
bfd_arch_last
};
}
bfd_reloc_status_type;
+typedef const struct reloc_howto_struct reloc_howto_type;
typedef struct reloc_cache_entry
{
unsigned number. */
complain_overflow_unsigned
};
-struct bfd_symbol; /* Forward declaration. */
-
struct reloc_howto_struct
{
- /* The type field has mainly a documentary use - the back end can
- do what it wants with it, though normally the back end's
- external idea of what a reloc number is stored
- in this field. For example, a PC relative word relocation
- in a coff environment has the type 023 - because that's
- what the outside world calls a R_PCRWORD reloc. */
+ /* The type field has mainly a documentary use - the back end can
+ do what it wants with it, though normally the back end's idea of
+ an external reloc number is stored in this field. */
unsigned int type;
- /* The value the final relocation is shifted right by. This drops
- unwanted data from the relocation. */
- unsigned int rightshift;
+ /* The encoded size of the item to be relocated. This is *not* a
+ power-of-two measure. Use bfd_get_reloc_size to find the size
+ of the item in bytes. */
+ unsigned int size:3;
- /* The size of the item to be relocated. This is *not* a
- power-of-two measure. To get the number of bytes operated
- on by a type of relocation, use bfd_get_reloc_size. */
- int size;
+ /* The number of bits in the field to be relocated. This is used
+ when doing overflow checking. */
+ unsigned int bitsize:7;
- /* The number of bits in the item to be relocated. This is used
- when doing overflow checking. */
- unsigned int bitsize;
+ /* The value the final relocation is shifted right by. This drops
+ unwanted data from the relocation. */
+ unsigned int rightshift:6;
- /* The relocation is relative to the field being relocated. */
- bfd_boolean pc_relative;
-
- /* The bit position of the reloc value in the destination.
- The relocated value is left shifted by this amount. */
- unsigned int bitpos;
+ /* The bit position of the reloc value in the destination.
+ The relocated value is left shifted by this amount. */
+ unsigned int bitpos:6;
/* What type of overflow error should be checked for when
relocating. */
- enum complain_overflow complain_on_overflow;
+ ENUM_BITFIELD (complain_overflow) complain_on_overflow:2;
- /* If this field is non null, then the supplied function is
- called rather than the normal function. This allows really
- strange relocation methods to be accommodated. */
- bfd_reloc_status_type (*special_function)
- (bfd *, arelent *, struct bfd_symbol *, void *, asection *,
- bfd *, char **);
+ /* The relocation value should be negated before applying. */
+ unsigned int negate:1;
- /* The textual name of the relocation type. */
- char *name;
+ /* The relocation is relative to the item being relocated. */
+ unsigned int pc_relative:1;
/* Some formats record a relocation addend in the section contents
rather than with the relocation. For ELF formats this is the
USE_REL targets set this field to TRUE. Why this is so is peculiar
to each particular target. For relocs that aren't used in partial
links (e.g. GOT stuff) it doesn't matter what this is set to. */
- bfd_boolean partial_inplace;
+ unsigned int partial_inplace:1;
+
+ /* When some formats create PC relative instructions, they leave
+ the value of the pc of the place being relocated in the offset
+ slot of the instruction, so that a PC relative relocation can
+ be made just by adding in an ordinary offset (e.g., sun3 a.out).
+ Some formats leave the displacement part of an instruction
+ empty (e.g., ELF); this flag signals the fact. */
+ unsigned int pcrel_offset:1;
/* src_mask selects the part of the instruction (or data) to be used
in the relocation sum. If the target relocations don't have an
addend in the reloc, eg. ELF USE_REL, src_mask will normally equal
dst_mask to extract the addend from the section contents. If
relocations do have an addend in the reloc, eg. ELF USE_RELA, this
- field should be zero. Non-zero values for ELF USE_RELA targets are
- bogus as in those cases the value in the dst_mask part of the
- section contents should be treated as garbage. */
+ field should normally be zero. Non-zero values for ELF USE_RELA
+ targets should be viewed with suspicion as normally the value in
+ the dst_mask part of the section contents should be ignored. */
bfd_vma src_mask;
/* dst_mask selects which parts of the instruction (or data) are
replaced with a relocated value. */
bfd_vma dst_mask;
- /* When some formats create PC relative instructions, they leave
- the value of the pc of the place being relocated in the offset
- slot of the instruction, so that a PC relative relocation can
- be made just by adding in an ordinary offset (e.g., sun3 a.out).
- Some formats leave the displacement part of an instruction
- empty (e.g., m88k bcs); this flag signals the fact. */
- bfd_boolean pcrel_offset;
-};
+ /* If this field is non null, then the supplied function is
+ called rather than the normal function. This allows really
+ strange relocation methods to be accommodated. */
+ bfd_reloc_status_type (*special_function)
+ (bfd *, arelent *, struct bfd_symbol *, void *, asection *,
+ bfd *, char **);
-#define HOWTO(C, R, S, B, P, BI, O, SF, NAME, INPLACE, MASKSRC, MASKDST, PC) \
- { (unsigned) C, R, S, B, P, BI, O, SF, NAME, INPLACE, MASKSRC, MASKDST, PC }
-#define NEWHOWTO(FUNCTION, NAME, SIZE, REL, IN) \
- HOWTO (0, 0, SIZE, 0, REL, 0, complain_overflow_dont, FUNCTION, \
- NAME, FALSE, 0, 0, IN)
+ /* The textual name of the relocation type. */
+ char *name;
+};
+#define HOWTO(type, right, size, bits, pcrel, left, ovf, func, name, \
+ inplace, src_mask, dst_mask, pcrel_off) \
+ { (unsigned) type, size < 0 ? -size : size, bits, right, left, ovf, \
+ size < 0, pcrel, inplace, pcrel_off, src_mask, dst_mask, func, name }
#define EMPTY_HOWTO(C) \
HOWTO ((C), 0, 0, 0, FALSE, 0, complain_overflow_dont, NULL, \
NULL, FALSE, 0, 0, FALSE)
-#define HOWTO_PREPARE(relocation, symbol) \
- { \
- if (symbol != NULL) \
- { \
- if (bfd_is_com_section (symbol->section)) \
- { \
- relocation = 0; \
- } \
- else \
- { \
- relocation = symbol->value; \
- } \
- } \
- }
-
unsigned int bfd_get_reloc_size (reloc_howto_type *);
typedef struct relent_chain
BFD_RELOC_PPC64_PLTGOT16_LO_DS,
BFD_RELOC_PPC64_ADDR16_HIGH,
BFD_RELOC_PPC64_ADDR16_HIGHA,
+ BFD_RELOC_PPC64_REL16_HIGH,
+ BFD_RELOC_PPC64_REL16_HIGHA,
+ BFD_RELOC_PPC64_REL16_HIGHER,
+ BFD_RELOC_PPC64_REL16_HIGHERA,
+ BFD_RELOC_PPC64_REL16_HIGHEST,
+ BFD_RELOC_PPC64_REL16_HIGHESTA,
BFD_RELOC_PPC64_ADDR64_LOCAL,
BFD_RELOC_PPC64_ENTRY,
+ BFD_RELOC_PPC64_REL24_NOTOC,
+ BFD_RELOC_PPC64_D34,
+ BFD_RELOC_PPC64_D34_LO,
+ BFD_RELOC_PPC64_D34_HI30,
+ BFD_RELOC_PPC64_D34_HA30,
+ BFD_RELOC_PPC64_PCREL34,
+ BFD_RELOC_PPC64_GOT_PCREL34,
+ BFD_RELOC_PPC64_PLT_PCREL34,
+ BFD_RELOC_PPC64_ADDR16_HIGHER34,
+ BFD_RELOC_PPC64_ADDR16_HIGHERA34,
+ BFD_RELOC_PPC64_ADDR16_HIGHEST34,
+ BFD_RELOC_PPC64_ADDR16_HIGHESTA34,
+ BFD_RELOC_PPC64_REL16_HIGHER34,
+ BFD_RELOC_PPC64_REL16_HIGHERA34,
+ BFD_RELOC_PPC64_REL16_HIGHEST34,
+ BFD_RELOC_PPC64_REL16_HIGHESTA34,
+ BFD_RELOC_PPC64_D28,
+ BFD_RELOC_PPC64_PCREL28,
/* PowerPC and PowerPC64 thread-local storage relocations. */
BFD_RELOC_PPC_TLS,
BFD_RELOC_PPC_GOT_DTPREL16_HA,
BFD_RELOC_PPC64_TPREL16_DS,
BFD_RELOC_PPC64_TPREL16_LO_DS,
+ BFD_RELOC_PPC64_TPREL16_HIGH,
+ BFD_RELOC_PPC64_TPREL16_HIGHA,
BFD_RELOC_PPC64_TPREL16_HIGHER,
BFD_RELOC_PPC64_TPREL16_HIGHERA,
BFD_RELOC_PPC64_TPREL16_HIGHEST,
BFD_RELOC_PPC64_TPREL16_HIGHESTA,
BFD_RELOC_PPC64_DTPREL16_DS,
BFD_RELOC_PPC64_DTPREL16_LO_DS,
+ BFD_RELOC_PPC64_DTPREL16_HIGH,
+ BFD_RELOC_PPC64_DTPREL16_HIGHA,
BFD_RELOC_PPC64_DTPREL16_HIGHER,
BFD_RELOC_PPC64_DTPREL16_HIGHERA,
BFD_RELOC_PPC64_DTPREL16_HIGHEST,
BFD_RELOC_PPC64_DTPREL16_HIGHESTA,
- BFD_RELOC_PPC64_TPREL16_HIGH,
- BFD_RELOC_PPC64_TPREL16_HIGHA,
- BFD_RELOC_PPC64_DTPREL16_HIGH,
- BFD_RELOC_PPC64_DTPREL16_HIGHA,
/* IBM 370/390 relocations */
BFD_RELOC_I370_D12,
/* ARM 26-bit pc-relative branch for B or conditional BL instruction. */
BFD_RELOC_ARM_PCREL_JUMP,
+/* ARM 5-bit pc-relative branch for Branch Future instructions. */
+ BFD_RELOC_THUMB_PCREL_BRANCH5,
+
+/* ARM 6-bit pc-relative branch for BFCSEL instruction. */
+ BFD_RELOC_THUMB_PCREL_BFCSEL,
+
+/* ARM 17-bit pc-relative branch for Branch Future instructions. */
+ BFD_RELOC_ARM_THUMB_BF17,
+
+/* ARM 13-bit pc-relative branch for BFCSEL instruction. */
+ BFD_RELOC_ARM_THUMB_BF13,
+
+/* ARM 19-bit pc-relative branch for Branch Future Link instruction. */
+ BFD_RELOC_ARM_THUMB_BF19,
+
+/* ARM 12-bit pc-relative branch for Low Overhead Loop instructions. */
+ BFD_RELOC_ARM_THUMB_LOOP12,
+
/* Thumb 7-, 9-, 12-, 20-, 23-, and 25-bit pc-relative branches.
The lowest bit must be zero and is not stored in the instruction.
Note that the corresponding ELF R_ARM_THM_JUMPnn constant has an
BFD_RELOC_ARM_THUMB_MOVW_PCREL,
BFD_RELOC_ARM_THUMB_MOVT_PCREL,
+/* ARM FDPIC specific relocations. */
+ BFD_RELOC_ARM_GOTFUNCDESC,
+ BFD_RELOC_ARM_GOTOFFFUNCDESC,
+ BFD_RELOC_ARM_FUNCDESC,
+ BFD_RELOC_ARM_FUNCDESC_VALUE,
+ BFD_RELOC_ARM_TLS_GD32_FDPIC,
+ BFD_RELOC_ARM_TLS_LDM32_FDPIC,
+ BFD_RELOC_ARM_TLS_IE32_FDPIC,
+
/* Relocations for setting up GOTs and PLTs for shared libraries. */
BFD_RELOC_ARM_JUMP_SLOT,
BFD_RELOC_ARM_GLOB_DAT,
BFD_RELOC_ARM_CP_OFF_IMM_S2,
BFD_RELOC_ARM_T32_CP_OFF_IMM,
BFD_RELOC_ARM_T32_CP_OFF_IMM_S2,
+ BFD_RELOC_ARM_T32_VLDR_VSTR_OFF_IMM,
BFD_RELOC_ARM_ADR_IMM,
BFD_RELOC_ARM_LDR_IMM,
BFD_RELOC_ARM_LITERAL,
/* For TLS. */
BFD_RELOC_NDS32_TPOFF,
+ BFD_RELOC_NDS32_GOTTPOFF,
BFD_RELOC_NDS32_TLS_LE_HI20,
BFD_RELOC_NDS32_TLS_LE_LO12,
- BFD_RELOC_NDS32_TLS_LE_ADD,
- BFD_RELOC_NDS32_TLS_LE_LS,
- BFD_RELOC_NDS32_GOTTPOFF,
- BFD_RELOC_NDS32_TLS_IE_HI20,
- BFD_RELOC_NDS32_TLS_IE_LO12S2,
- BFD_RELOC_NDS32_TLS_TPOFF,
BFD_RELOC_NDS32_TLS_LE_20,
BFD_RELOC_NDS32_TLS_LE_15S0,
BFD_RELOC_NDS32_TLS_LE_15S1,
BFD_RELOC_NDS32_TLS_LE_15S2,
+ BFD_RELOC_NDS32_TLS_LE_ADD,
+ BFD_RELOC_NDS32_TLS_LE_LS,
+ BFD_RELOC_NDS32_TLS_IE_HI20,
+ BFD_RELOC_NDS32_TLS_IE_LO12,
+ BFD_RELOC_NDS32_TLS_IE_LO12S2,
+ BFD_RELOC_NDS32_TLS_IEGP_HI20,
+ BFD_RELOC_NDS32_TLS_IEGP_LO12,
+ BFD_RELOC_NDS32_TLS_IEGP_LO12S2,
+ BFD_RELOC_NDS32_TLS_IEGP_LW,
+ BFD_RELOC_NDS32_TLS_DESC,
+ BFD_RELOC_NDS32_TLS_DESC_HI20,
+ BFD_RELOC_NDS32_TLS_DESC_LO12,
+ BFD_RELOC_NDS32_TLS_DESC_20,
+ BFD_RELOC_NDS32_TLS_DESC_SDA17S2,
+ BFD_RELOC_NDS32_TLS_DESC_ADD,
+ BFD_RELOC_NDS32_TLS_DESC_FUNC,
+ BFD_RELOC_NDS32_TLS_DESC_CALL,
+ BFD_RELOC_NDS32_TLS_DESC_MEM,
+ BFD_RELOC_NDS32_REMOVE,
+ BFD_RELOC_NDS32_GROUP,
+
+/* For floating load store relaxation. */
+ BFD_RELOC_NDS32_LSI,
/* This is a 9-bit reloc */
BFD_RELOC_V850_9_PCREL,
a matching LO8XG part. */
BFD_RELOC_M68HC12_HI8XG,
+/* Freescale S12Z reloc.
+This is a 15 bit relative address. If the most significant bits are all zero
+then it may be truncated to 8 bits. */
+ BFD_RELOC_S12Z_15_PCREL,
+
/* NS CR16C Relocations. */
BFD_RELOC_16C_NUM08,
BFD_RELOC_16C_NUM08_C,
/* OpenRISC 1000 Relocations. */
BFD_RELOC_OR1K_REL_26,
+ BFD_RELOC_OR1K_SLO16,
+ BFD_RELOC_OR1K_PCREL_PG21,
+ BFD_RELOC_OR1K_LO13,
+ BFD_RELOC_OR1K_SLO13,
BFD_RELOC_OR1K_GOTPC_HI16,
BFD_RELOC_OR1K_GOTPC_LO16,
BFD_RELOC_OR1K_GOT16,
+ BFD_RELOC_OR1K_GOT_PG21,
+ BFD_RELOC_OR1K_GOT_LO13,
BFD_RELOC_OR1K_PLT26,
- BFD_RELOC_OR1K_GOTOFF_HI16,
- BFD_RELOC_OR1K_GOTOFF_LO16,
+ BFD_RELOC_OR1K_PLTA26,
+ BFD_RELOC_OR1K_GOTOFF_SLO16,
BFD_RELOC_OR1K_COPY,
BFD_RELOC_OR1K_GLOB_DAT,
BFD_RELOC_OR1K_JMP_SLOT,
BFD_RELOC_OR1K_RELATIVE,
BFD_RELOC_OR1K_TLS_GD_HI16,
BFD_RELOC_OR1K_TLS_GD_LO16,
+ BFD_RELOC_OR1K_TLS_GD_PG21,
+ BFD_RELOC_OR1K_TLS_GD_LO13,
BFD_RELOC_OR1K_TLS_LDM_HI16,
BFD_RELOC_OR1K_TLS_LDM_LO16,
+ BFD_RELOC_OR1K_TLS_LDM_PG21,
+ BFD_RELOC_OR1K_TLS_LDM_LO13,
BFD_RELOC_OR1K_TLS_LDO_HI16,
BFD_RELOC_OR1K_TLS_LDO_LO16,
BFD_RELOC_OR1K_TLS_IE_HI16,
+ BFD_RELOC_OR1K_TLS_IE_AHI16,
BFD_RELOC_OR1K_TLS_IE_LO16,
+ BFD_RELOC_OR1K_TLS_IE_PG21,
+ BFD_RELOC_OR1K_TLS_IE_LO13,
BFD_RELOC_OR1K_TLS_LE_HI16,
+ BFD_RELOC_OR1K_TLS_LE_AHI16,
BFD_RELOC_OR1K_TLS_LE_LO16,
+ BFD_RELOC_OR1K_TLS_LE_SLO16,
BFD_RELOC_OR1K_TLS_TPOFF,
BFD_RELOC_OR1K_TLS_DTPOFF,
BFD_RELOC_OR1K_TLS_DTPMOD,
/* Same as BFD_RELOC_32_PCREL but with an implicit -4 addend. */
BFD_RELOC_MACH_O_X86_64_PCREL32_4,
+/* Used when referencing a TLV entry. */
+ BFD_RELOC_MACH_O_X86_64_TLV,
+
/* Addend for PAGE or PAGEOFF. */
BFD_RELOC_MACH_O_ARM64_ADDEND,
to two words (uses imm instruction). */
BFD_RELOC_MICROBLAZE_64_TLSTPREL,
+/* This is a 64 bit reloc that stores the 32 bit pc relative
+value in two words (with an imm instruction). The relocation is
+PC-relative offset from start of TEXT. */
+ BFD_RELOC_MICROBLAZE_64_TEXTPCREL,
+
+/* This is a 64 bit reloc that stores the 32 bit offset
+value in two words (with an imm instruction). The relocation is
+relative offset from start of TEXT. */
+ BFD_RELOC_MICROBLAZE_64_TEXTREL,
+
/* AArch64 pseudo relocation code to mark the start of the AArch64
relocation enumerators. N.B. the order of the enumerators is
important as several tables in the AArch64 bfd backend are indexed
BFD_RELOC_TILEGX_IMM8_Y0_TLS_ADD,
BFD_RELOC_TILEGX_IMM8_Y1_TLS_ADD,
+/* Linux eBPF relocations. */
+ BFD_RELOC_BPF_64,
+ BFD_RELOC_BPF_32,
+ BFD_RELOC_BPF_16,
+ BFD_RELOC_BPF_DISP16,
+ BFD_RELOC_BPF_DISP32,
+
/* Adapteva EPIPHANY - 8 bit signed pc-relative displacement */
BFD_RELOC_EPIPHANY_SIMM8,
BFD_RELOC_WASM32_CODE_POINTER,
BFD_RELOC_WASM32_INDEX,
BFD_RELOC_WASM32_PLT_SIG,
+
+/* C-SKY relocations. */
+ BFD_RELOC_CKCORE_NONE,
+ BFD_RELOC_CKCORE_ADDR32,
+ BFD_RELOC_CKCORE_PCREL_IMM8BY4,
+ BFD_RELOC_CKCORE_PCREL_IMM11BY2,
+ BFD_RELOC_CKCORE_PCREL_IMM4BY2,
+ BFD_RELOC_CKCORE_PCREL32,
+ BFD_RELOC_CKCORE_PCREL_JSR_IMM11BY2,
+ BFD_RELOC_CKCORE_GNU_VTINHERIT,
+ BFD_RELOC_CKCORE_GNU_VTENTRY,
+ BFD_RELOC_CKCORE_RELATIVE,
+ BFD_RELOC_CKCORE_COPY,
+ BFD_RELOC_CKCORE_GLOB_DAT,
+ BFD_RELOC_CKCORE_JUMP_SLOT,
+ BFD_RELOC_CKCORE_GOTOFF,
+ BFD_RELOC_CKCORE_GOTPC,
+ BFD_RELOC_CKCORE_GOT32,
+ BFD_RELOC_CKCORE_PLT32,
+ BFD_RELOC_CKCORE_ADDRGOT,
+ BFD_RELOC_CKCORE_ADDRPLT,
+ BFD_RELOC_CKCORE_PCREL_IMM26BY2,
+ BFD_RELOC_CKCORE_PCREL_IMM16BY2,
+ BFD_RELOC_CKCORE_PCREL_IMM16BY4,
+ BFD_RELOC_CKCORE_PCREL_IMM10BY2,
+ BFD_RELOC_CKCORE_PCREL_IMM10BY4,
+ BFD_RELOC_CKCORE_ADDR_HI16,
+ BFD_RELOC_CKCORE_ADDR_LO16,
+ BFD_RELOC_CKCORE_GOTPC_HI16,
+ BFD_RELOC_CKCORE_GOTPC_LO16,
+ BFD_RELOC_CKCORE_GOTOFF_HI16,
+ BFD_RELOC_CKCORE_GOTOFF_LO16,
+ BFD_RELOC_CKCORE_GOT12,
+ BFD_RELOC_CKCORE_GOT_HI16,
+ BFD_RELOC_CKCORE_GOT_LO16,
+ BFD_RELOC_CKCORE_PLT12,
+ BFD_RELOC_CKCORE_PLT_HI16,
+ BFD_RELOC_CKCORE_PLT_LO16,
+ BFD_RELOC_CKCORE_ADDRGOT_HI16,
+ BFD_RELOC_CKCORE_ADDRGOT_LO16,
+ BFD_RELOC_CKCORE_ADDRPLT_HI16,
+ BFD_RELOC_CKCORE_ADDRPLT_LO16,
+ BFD_RELOC_CKCORE_PCREL_JSR_IMM26BY2,
+ BFD_RELOC_CKCORE_TOFFSET_LO16,
+ BFD_RELOC_CKCORE_DOFFSET_LO16,
+ BFD_RELOC_CKCORE_PCREL_IMM18BY2,
+ BFD_RELOC_CKCORE_DOFFSET_IMM18,
+ BFD_RELOC_CKCORE_DOFFSET_IMM18BY2,
+ BFD_RELOC_CKCORE_DOFFSET_IMM18BY4,
+ BFD_RELOC_CKCORE_GOTOFF_IMM18,
+ BFD_RELOC_CKCORE_GOT_IMM18BY4,
+ BFD_RELOC_CKCORE_PLT_IMM18BY4,
+ BFD_RELOC_CKCORE_PCREL_IMM7BY4,
+ BFD_RELOC_CKCORE_TLS_LE32,
+ BFD_RELOC_CKCORE_TLS_IE32,
+ BFD_RELOC_CKCORE_TLS_GD32,
+ BFD_RELOC_CKCORE_TLS_LDM32,
+ BFD_RELOC_CKCORE_TLS_LDO32,
+ BFD_RELOC_CKCORE_TLS_DTPMOD32,
+ BFD_RELOC_CKCORE_TLS_DTPOFF32,
+ BFD_RELOC_CKCORE_TLS_TPOFF32,
+ BFD_RELOC_CKCORE_PCREL_FLRW_IMM8BY4,
+ BFD_RELOC_CKCORE_NOJSRI,
+ BFD_RELOC_CKCORE_CALLGRAPH,
+ BFD_RELOC_CKCORE_IRELATIVE,
+ BFD_RELOC_CKCORE_PCREL_BLOOP_IMM4BY4,
+ BFD_RELOC_CKCORE_PCREL_BLOOP_IMM12BY4,
+
+/* S12Z relocations. */
+ BFD_RELOC_S12Z_OPR,
BFD_RELOC_UNUSED };
typedef enum bfd_reloc_code_real bfd_reloc_code_real_type;
least-recently-used list of BFDs. */
struct bfd *lru_prev, *lru_next;
- /* When a file is closed by the caching routines, BFD retains
- state information on the file here... */
+ /* Track current file position (or current buffer offset for
+ in-memory BFDs). When a file is closed by the caching routines,
+ BFD retains state information on the file here. */
ufile_ptr where;
/* File modified time, if mtime_set is TRUE. */
{
struct aout_data_struct *aout_data;
struct artdata *aout_ar_data;
- struct _oasys_data *oasys_obj_data;
- struct _oasys_ar_data *oasys_ar_data;
struct coff_tdata *coff_obj_data;
struct pe_tdata *pe_obj_data;
struct xcoff_tdata *xcoff_obj_data;
typedef void (*bfd_error_handler_type) (const char *, va_list);
+void _bfd_error_handler (const char *fmt, ...) ATTRIBUTE_PRINTF_1;
+
bfd_error_handler_type bfd_set_error_handler (bfd_error_handler_type);
void bfd_set_error_program_name (const char *);
bfd_boolean bfd_check_compression_header
(bfd *abfd, bfd_byte *contents, asection *sec,
- bfd_size_type *uncompressed_size);
+ bfd_size_type *uncompressed_size,
+ unsigned int *uncompressed_alignment_power);
int bfd_get_compression_header_size (bfd *abfd, asection *sec);
bfd_target_ecoff_flavour,
bfd_target_xcoff_flavour,
bfd_target_elf_flavour,
- bfd_target_oasys_flavour,
bfd_target_tekhex_flavour,
bfd_target_srec_flavour,
bfd_target_verilog_flavour,
NAME##_bfd_discard_group, \
NAME##_section_already_linked, \
NAME##_bfd_define_common_symbol, \
+ NAME##_bfd_link_hide_symbol, \
NAME##_bfd_define_start_stop
int (*_bfd_sizeof_headers) (bfd *, struct bfd_link_info *);
bfd_boolean (*_bfd_define_common_symbol) (bfd *, struct bfd_link_info *,
struct bfd_link_hash_entry *);
+ /* Hide a symbol. */
+ void (*_bfd_link_hide_symbol) (bfd *, struct bfd_link_info *,
+ struct bfd_link_hash_entry *);
+
/* Define a __start, __stop, .startof. or .sizeof. symbol. */
struct bfd_link_hash_entry *
(*_bfd_define_start_stop) (struct bfd_link_info *, const char *,
const char *bfd_format_string (bfd_format format);
/* Extracted from linker.c. */
+/* Return TRUE if the symbol described by a linker hash entry H
+ is going to be absolute. Linker-script defined symbols can be
+ converted from absolute to section-relative ones late in the
+ link. Use this macro to correctly determine whether the symbol
+ will actually end up absolute in output. */
+#define bfd_is_abs_symbol(H) \
+ (((H)->type == bfd_link_hash_defined \
+ || (H)->type == bfd_link_hash_defweak) \
+ && bfd_is_abs_section ((H)->u.def.section) \
+ && !(H)->rel_from_abs)
+
bfd_boolean bfd_link_split_section (bfd *abfd, asection *sec);
#define bfd_link_split_section(abfd, sec) \
#define bfd_define_common_symbol(output_bfd, info, h) \
BFD_SEND (output_bfd, _bfd_define_common_symbol, (output_bfd, info, h))
+void _bfd_generic_link_hide_symbol
+ (bfd *output_bfd, struct bfd_link_info *info,
+ struct bfd_link_hash_entry *h);
+
+#define bfd_link_hide_symbol(output_bfd, info, h) \
+ BFD_SEND (output_bfd, _bfd_link_hide_symbol, (output_bfd, info, h))
+
struct bfd_link_hash_entry *bfd_generic_define_start_stop
(struct bfd_link_info *info,
const char *symbol, asection *sec);
bfd_boolean bfd_is_section_compressed_with_header
(bfd *abfd, asection *section,
int *compression_header_size_p,
- bfd_size_type *uncompressed_size_p);
+ bfd_size_type *uncompressed_size_p,
+ unsigned int *uncompressed_alignment_power_p);
bfd_boolean bfd_is_section_compressed
(bfd *abfd, asection *section);