/* BFD back-end data structures for ELF files.
- Copyright (C) 1992-2019 Free Software Foundation, Inc.
+ Copyright (C) 1992-2020 Free Software Foundation, Inc.
Written by Cygnus Support.
This file is part of BFD, the Binary File Descriptor library.
/* This function is called to modify program headers just before
they are written. */
- bfd_boolean (*elf_backend_modify_program_headers)
+ bfd_boolean (*elf_backend_modify_headers)
(bfd *, struct bfd_link_info *);
/* This function is called to see if the PHDR header should be
bfd_boolean (*gc_mark_extra_sections)
(struct bfd_link_info *, elf_gc_mark_hook_fn);
- /* This function, if defined, is called after the ELF headers have
- been created. This allows for things like the OS and ABI versions
- to be changed. */
- void (*elf_backend_post_process_headers)
+ /* This function is called to initialise ELF file header info.
+ Customised versions can modify things like the OS and ABI version. */
+ bfd_boolean (*elf_backend_init_file_header)
(bfd *, struct bfd_link_info *);
/* This function, if defined, prints a symbol to file and returns the
int (*target_read_memory) (bfd_vma vma, bfd_byte *myaddr,
bfd_size_type len));
+ bfd_boolean (*elf_backend_core_find_build_id) (bfd *, bfd_vma);
+
/* This function is used by `_bfd_elf_get_synthetic_symtab';
see elf.c. */
bfd_vma (*plt_sym_val) (bfd_vma, const asection *, const arelent *);
extern Elf_Internal_Sym *bfd_elf_get_elf_syms
(bfd *, Elf_Internal_Shdr *, size_t, size_t, Elf_Internal_Sym *, void *,
Elf_External_Sym_Shndx *);
+extern char * bfd_elf_get_str_section (bfd *, unsigned int);
extern const char *bfd_elf_sym_name
(bfd *, Elf_Internal_Shdr *, Elf_Internal_Sym *, asection *);
(struct elf_strtab_hash *, void *);
extern bfd_size_type _bfd_elf_strtab_size
(struct elf_strtab_hash *);
+extern bfd_size_type _bfd_elf_strtab_len
+ (struct elf_strtab_hash *);
extern bfd_size_type _bfd_elf_strtab_offset
(struct elf_strtab_hash *, size_t);
+extern const char * _bfd_elf_strtab_str
+ (struct elf_strtab_hash *, size_t idx, bfd_size_type *offset);
extern bfd_boolean _bfd_elf_strtab_emit
(bfd *, struct elf_strtab_hash *);
extern void _bfd_elf_strtab_finalize
(bfd *, struct bfd_link_info *);
extern file_ptr _bfd_elf_assign_file_position_for_section
(Elf_Internal_Shdr *, file_ptr, bfd_boolean);
+extern bfd_boolean _bfd_elf_modify_headers
+ (bfd *, struct bfd_link_info *);
extern bfd_boolean _bfd_elf_validate_reloc
(bfd *, arelent *);
extern struct bfd_link_hash_entry *bfd_elf_define_start_stop
(struct bfd_link_info *, const char *, asection *);
-extern void _bfd_elf_post_process_headers (bfd *, struct bfd_link_info *);
+extern bfd_boolean _bfd_elf_init_file_header (bfd *, struct bfd_link_info *);
extern bfd_boolean _bfd_elf_final_write_processing (bfd *);
(bfd *, bfd *);
extern int bfd_elf32_core_file_pid
(bfd *);
+extern bfd_boolean _bfd_elf32_core_find_build_id
+ (bfd *, bfd_vma);
extern bfd_boolean bfd_elf32_swap_symbol_in
(bfd *, const void *, const void *, Elf_Internal_Sym *);
(bfd *, bfd *);
extern int bfd_elf64_core_file_pid
(bfd *);
+extern bfd_boolean _bfd_elf64_core_find_build_id
+ (bfd *, bfd_vma);
extern bfd_boolean bfd_elf64_swap_symbol_in
(bfd *, const void *, const void *, Elf_Internal_Sym *);
extern bfd_boolean _bfd_elf_merge_unknown_attribute_low (bfd *, bfd *, int);
extern bfd_boolean _bfd_elf_merge_unknown_attribute_list (bfd *, bfd *);
extern Elf_Internal_Shdr *_bfd_elf_single_rel_hdr (asection *sec);
+extern bfd_boolean elf_read_notes (bfd *, file_ptr, bfd_size_type, size_t);
extern bfd_boolean _bfd_elf_parse_gnu_properties
(bfd *, Elf_Internal_Note *);
/* Hash for local symbol with the first section id, ID, in the input
file and the local symbol index, SYM. */
#define ELF_LOCAL_SYMBOL_HASH(ID, SYM) \
- (((((ID) & 0xff) << 24) | (((ID) & 0xff00) << 8)) \
- ^ (SYM) ^ ((ID) >> 16))
+ (((((ID) & 0xffU) << 24) | (((ID) & 0xff00) << 8)) \
+ ^ (SYM) ^ (((ID) & 0xffff0000U) >> 16))
/* This is the condition under which finish_dynamic_symbol will be called.
If our finish_dynamic_symbol isn't called, we'll need to do something
|| (H)->start_stop \
|| ((INFO)->dynamic && !(H)->dynamic)))
+/* Determine if a section contains CTF data, using its name. */
+static inline bfd_boolean
+bfd_section_is_ctf (const asection *sec)
+{
+ const char *name = bfd_section_name (sec);
+ return strncmp (name, ".ctf", 4) == 0 && (name[4] == 0 || name[4] == '.');
+}
+
#ifdef __cplusplus
}
#endif