/* Structures used by the eh_frame optimization code. */
struct eh_cie_fde
{
- /* For FDEs, this points to the CIE used. */
- struct eh_cie_fde *cie_inf;
+ union {
+ struct {
+ /* If REMOVED == 1, this is the CIE that the FDE originally used.
+ The CIE belongs to the same .eh_frame input section as the FDE.
+
+ If REMOVED == 0, this is the CIE that we have chosen to use for
+ the output FDE. The CIE's REMOVED field is also 0, but the CIE
+ might belong to a different .eh_frame input section from the FDE. */
+ struct eh_cie_fde *cie_inf;
+ } fde;
+ struct {
+ /* In general, equivalent CIEs are grouped together, with one CIE
+ representing all the others in a group. If REMOVED == 0,
+ this CIE is the group representative. If REMOVED == 1,
+ following this pointer brings us "closer" to the CIE's group
+ representative, and reapplying always gives the representative. */
+ struct eh_cie_fde *merged;
+ } cie;
+ } u;
+ unsigned int reloc_index;
unsigned int size;
unsigned int offset;
unsigned int new_offset;
- unsigned char fde_encoding;
- unsigned char lsda_encoding;
- unsigned char lsda_offset;
+ unsigned int fde_encoding : 8;
+ unsigned int lsda_encoding : 8;
+ unsigned int lsda_offset : 8;
unsigned int cie : 1;
unsigned int removed : 1;
unsigned int add_augmentation_size : 1;
asection *hdr_sec;
unsigned int fde_count, array_count;
struct eh_frame_array_ent *array;
+ /* TRUE if all .eh_frames have been parsd. */
+ bfd_boolean parsed_eh_frames;
/* TRUE if .eh_frame_hdr should contain the sorted search table.
We build it if we successfully read all .eh_frame input sections
and recognize them. */
{
bfd *abfd;
unsigned long indx[LOCAL_SYM_CACHE_SIZE];
- asection *sec[LOCAL_SYM_CACHE_SIZE];
+ unsigned int shndx[LOCAL_SYM_CACHE_SIZE];
};
\f
/* Constant information held for an ELF backend. */
(bfd *, const Elf_Internal_Phdr *, unsigned int);
bfd_boolean
(*write_shdrs_and_ehdr) (bfd *);
+ bfd_boolean (*checksum_contents)
+ (bfd * , void (*) (const void *, size_t, void *), void *);
void (*write_relocs)
(bfd *, asection *, void *);
bfd_boolean (*swap_symbol_in)
bfd_boolean (*elf_backend_omit_section_dynsym)
(bfd *output_bfd, struct bfd_link_info *info, asection *osec);
+ /* Return TRUE if relocations of targets are compatible to the extent
+ that CHECK_RELOCS will properly process them. PR 4424. */
+ bfd_boolean (*relocs_compatible) (const bfd_target *, const bfd_target *);
+
/* The CHECK_RELOCS function is called by the add_symbols phase of
the ELF backend linker. It is called once for each section with
relocs of an object file, just after the symbols for the object
char *(*elf_backend_write_core_note)
(bfd *abfd, char *buf, int *bufsiz, int note_type, ...);
- /* Functions to print VMAs. Special code to handle 64 bit ELF files. */
- void (* elf_backend_sprintf_vma)
- (bfd *, char *, bfd_vma);
- void (* elf_backend_fprintf_vma)
- (bfd *, void *, bfd_vma);
-
/* This function returns class of a reloc type. */
enum elf_reloc_type_class (*elf_backend_reloc_type_class)
(const Elf_Internal_Rela *);
#define elf_sec_group(sec) (elf_section_data(sec)->sec_group)
#define xvec_get_elf_backend_data(xvec) \
- ((struct elf_backend_data *) (xvec)->backend_data)
+ ((const struct elf_backend_data *) (xvec)->backend_data)
#define get_elf_backend_data(abfd) \
xvec_get_elf_backend_data ((abfd)->xvec)
/* Segment flags for the PT_GNU_STACK segment. */
unsigned int stack_flags;
- /* Should the PT_GNU_RELRO segment be emitted? */
- bfd_boolean relro;
-
/* Symbol version definitions in external objects. */
Elf_Internal_Verdef *verdef;
obj_attribute known_obj_attributes[2][NUM_KNOWN_OBJ_ATTRIBUTES];
obj_attribute_list *other_obj_attributes[2];
+
+ /* Called at the end of _bfd_elf_write_object_contents if not NULL. */
+ bfd_boolean (*after_write_object_contents) (bfd *);
+ void *after_write_object_contents_info;
+
+ /* NT_GNU_BUILD_ID note type. */
+ bfd_size_type build_id_size;
+ bfd_byte *build_id;
};
#define elf_tdata(bfd) ((bfd) -> tdata.elf_obj_data)
extern void bfd_elf_print_symbol
(bfd *, void *, asymbol *, bfd_print_symbol_type);
-extern void _bfd_elf_sprintf_vma
- (bfd *, char *, bfd_vma);
-extern void _bfd_elf_fprintf_vma
- (bfd *, void *, bfd_vma);
-
extern unsigned int _bfd_elf_eh_frame_address_size
(bfd *, asection *);
extern bfd_byte _bfd_elf_encode_eh_address
extern void _bfd_elf_strtab_finalize
(struct elf_strtab_hash *);
+extern void _bfd_elf_begin_eh_frame_parsing
+ (struct bfd_link_info *info);
+extern void _bfd_elf_parse_eh_frame
+ (bfd *, struct bfd_link_info *, asection *, struct elf_reloc_cookie *);
+extern void _bfd_elf_end_eh_frame_parsing
+ (struct bfd_link_info *info);
+
extern bfd_boolean _bfd_elf_discard_section_eh_frame
(bfd *, struct bfd_link_info *, asection *,
bfd_boolean (*) (bfd_vma, void *), struct elf_reloc_cookie *);
extern bfd_boolean _bfd_elf_symbol_refs_local_p
(struct elf_link_hash_entry *, struct bfd_link_info *, bfd_boolean);
-extern bfd_boolean bfd_elf_match_symbols_in_sections
- (asection *, asection *, struct bfd_link_info *);
-
-extern void bfd_elf_perform_complex_relocation
- (bfd * output_bfd ATTRIBUTE_UNUSED,
- struct bfd_link_info * info,
- bfd * input_bfd,
- asection * input_section,
- bfd_byte * contents,
- Elf_Internal_Rela * rel,
- Elf_Internal_Sym * local_syms,
- asection ** local_sections);
+extern bfd_reloc_status_type bfd_elf_perform_complex_relocation
+ (bfd *, asection *, bfd_byte *, Elf_Internal_Rela *, bfd_vma);
extern bfd_boolean _bfd_elf_setup_sections
(bfd *);
(bfd *);
extern int bfd_elf32_write_out_phdrs
(bfd *, const Elf_Internal_Phdr *, unsigned int);
+extern bfd_boolean bfd_elf32_checksum_contents
+ (bfd * , void (*) (const void *, size_t, void *), void *);
extern void bfd_elf32_write_relocs
(bfd *, asection *, void *);
extern bfd_boolean bfd_elf32_slurp_reloc_table
(bfd *);
extern int bfd_elf64_write_out_phdrs
(bfd *, const Elf_Internal_Phdr *, unsigned int);
+extern bfd_boolean bfd_elf64_checksum_contents
+ (bfd * , void (*) (const void *, size_t, void *), void *);
extern void bfd_elf64_write_relocs
(bfd *, asection *, void *);
extern bfd_boolean bfd_elf64_slurp_reloc_table
(bfd *, asection *, asymbol **, bfd_boolean);
+extern bfd_boolean _bfd_elf_default_relocs_compatible
+ (const bfd_target *, const bfd_target *);
+
+extern bfd_boolean _bfd_elf_relocs_compatible
+ (const bfd_target *, const bfd_target *);
+
extern struct elf_link_hash_entry *_bfd_elf_archive_symbol_lookup
(bfd *, struct bfd_link_info *, const char *);
extern bfd_boolean bfd_elf_link_add_symbols
(asection *, struct bfd_link_info *, Elf_Internal_Rela *,
struct elf_link_hash_entry *, Elf_Internal_Sym *);
+extern asection *_bfd_elf_gc_mark_rsec
+ (struct bfd_link_info *, asection *, elf_gc_mark_hook_fn,
+ struct elf_reloc_cookie *);
+
+extern bfd_boolean _bfd_elf_gc_mark_reloc
+ (struct bfd_link_info *, asection *, elf_gc_mark_hook_fn,
+ struct elf_reloc_cookie *, bfd_boolean);
+
extern bfd_boolean _bfd_elf_gc_mark
- (struct bfd_link_info *, asection *,
- asection * (*) (asection *, struct bfd_link_info *, Elf_Internal_Rela *,
- struct elf_link_hash_entry *, Elf_Internal_Sym *));
+ (struct bfd_link_info *, asection *, elf_gc_mark_hook_fn);
extern bfd_boolean bfd_elf_gc_common_finalize_got_offsets
(bfd *, struct bfd_link_info *);
(bfd *, char *, int *, const void *, int);
extern char *elfcore_write_prxfpreg
(bfd *, char *, int *, const void *, int);
+extern char *elfcore_write_ppc_vmx
+ (bfd *, char *, int *, const void *, int);
extern char *elfcore_write_lwpstatus
(bfd *, char *, int *, long, int, const void *);