aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf-bfd.h
diff options
context:
space:
mode:
authorKeith Seitz <keiths@redhat.com>2019-10-30 12:23:16 +0000
committerNick Clifton <nickc@redhat.com>2019-10-30 12:23:16 +0000
commit864619bb2e68e4ec8fa5bcfc87b00bf6667601e3 (patch)
tree59ff794f1e9d066ea4c64af4b336fdc8b7fd5d5f /bfd/elf-bfd.h
parenta712c56a9a2afe0ea5335bf9bf50a638d39b5484 (diff)
downloadgdb-864619bb2e68e4ec8fa5bcfc87b00bf6667601e3.zip
gdb-864619bb2e68e4ec8fa5bcfc87b00bf6667601e3.tar.gz
gdb-864619bb2e68e4ec8fa5bcfc87b00bf6667601e3.tar.bz2
Add the ability to the BFD library to read build-ids from core flies.
* elf-bfd.h (elf_backend_data) <elf_backend_core_find_build_id>: New field. (_bfd_elf32_core_find_build_id, _bfd_elf64_core_find_build_id): New functions. (elf_read_notes): Add declaration. * elf.c (elf_read_notes): Move elf-bfd.h. (_bfd_elf_core_find_build_id): New function. (bfd_section_from_phdr): Scan core file PT_LOAD segments for build-id if none is known. (elf_parse_notes): For core files, scan for notes. * elfcore.h (elf_core_file_matches_executable_p): If both BFDs have identical build-ids, then they match. (_bfd_elf_core_find_build_id): New function. * elfxx-target.h (elf_backend_core_find_build_id): Define. (elfNN_bed): Add elf_backend_core_find_build_id.
Diffstat (limited to 'bfd/elf-bfd.h')
-rw-r--r--bfd/elf-bfd.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/bfd/elf-bfd.h b/bfd/elf-bfd.h
index ccd2c35..7309499 100644
--- a/bfd/elf-bfd.h
+++ b/bfd/elf-bfd.h
@@ -1377,6 +1377,8 @@ struct elf_backend_data
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 *);
@@ -2403,6 +2405,8 @@ extern bfd_boolean bfd_elf32_core_file_matches_executable_p
(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 *);
@@ -2449,6 +2453,8 @@ extern bfd_boolean bfd_elf64_core_file_matches_executable_p
(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 *);
@@ -2773,6 +2779,7 @@ extern bfd_boolean _bfd_elf_merge_object_attributes
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 *);