aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bfd/ChangeLog49
-rw-r--r--bfd/aout-target.h3
-rw-r--r--bfd/bfd-in2.h11
-rw-r--r--bfd/bfd.c5
-rw-r--r--bfd/binary.c1
-rw-r--r--bfd/coff-rs6000.c2
-rw-r--r--bfd/coff64-rs6000.c2
-rw-r--r--bfd/dwarf2.c67
-rw-r--r--bfd/elf-bfd.h3
-rw-r--r--bfd/elf.c32
-rw-r--r--bfd/elf32-mips.c2
-rw-r--r--bfd/elf64-mips.c2
-rw-r--r--bfd/elfn32-mips.c2
-rw-r--r--bfd/elfxx-mips.h2
-rw-r--r--bfd/elfxx-target.h4
-rw-r--r--bfd/i386msdos.c1
-rw-r--r--bfd/ihex.c1
-rw-r--r--bfd/libbfd-in.h11
-rw-r--r--bfd/libbfd.h11
-rw-r--r--bfd/libcoff-in.h2
-rw-r--r--bfd/libcoff.h2
-rw-r--r--bfd/libecoff.h2
-rw-r--r--bfd/mach-o.h2
-rw-r--r--bfd/mmo.c1
-rw-r--r--bfd/pef.c1
-rw-r--r--bfd/plugin.c1
-rw-r--r--bfd/ppcboot.c1
-rw-r--r--bfd/som.h3
-rw-r--r--bfd/srec.c1
-rw-r--r--bfd/syms.c15
-rw-r--r--bfd/targets.c6
-rw-r--r--bfd/tekhex.c1
-rw-r--r--bfd/verilog.c1
-rw-r--r--bfd/vms-alpha.c2
-rw-r--r--bfd/wasm-module.c1
-rw-r--r--bfd/xsym.c1
36 files changed, 237 insertions, 17 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 50e60da..a0e1e87 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,52 @@
+2022-09-02 Aaron Merey <amerey@redhat.com>
+
+ * aout-target.h (MY_find_nearest_line_with_alt): New macro.
+ * bfd-in2.h: Regenerate.
+ * bfd.c (bfd_find_nearest_line_with_alt): New macro.
+ * binary.c (binary_find_nearest_line_with_alt): New macro.
+ * coff-rs6000.c (_bfd_xcoff_find_nearest_line_with_alt): New macro.
+ (rs6000_xcoff64_vec): Add coff_find_nearest_line_with_alt.
+ * dwarf2.c (_bfd_dwarf2_find_nearest_line): Calls
+ _bfd_dwarf2_find_nearest_line_with_alt.
+ (_bfd_dwarf2_find_nearest_line_with_alt): New function. Implements the
+ former _bfd_dwarf2_find_nearest_line. Adds parameter alt_filename.
+ Attempt to open alt_filename and use it as the .dwz file if not NULL.
+ * elf-bfd.h (_bfd_elf_find_nearest_line_with_alt): New declaration.
+ * elf.c (_bfd_elf_find_nearest_line): Calls
+ _bfd_elf_find_nearest_line_with_alt.
+ (_bfd_elf_find_nearest_line_with_alt): New function. Implements the
+ former _bfd_elf_find_nearest_line. Adds parameter alt_filename.
+ * elf32-mips.c (bfd_elf32_find_nearest_line_with_alt): New macro.
+ * elf64-mips.c (bfd_elf64_find_nearest_line_with_alt): New macro.
+ * elfn32-mips.c (bfd_elf32_find_nearest_line_with_alt): New macro.
+ * elfxx-mips.h (_bfd_mips_elf_find_nearest_line_with_alt): New macro.
+ * elfxx-target.h (bfd_elfNN_find_nearest_line_with_alt): New macro.
+ * i386mdos.c (msdos_find_nearest_line_with_alt): New macro.
+ * ihex.c (ihex_find_nearest_line_with_alt): New macro.
+ * libbfd-in.h (_bfd_nosymbols_find_nearest_line_with_alt): New
+ declaration.
+ (_bfd_dwarf2_find_nearest_line_with_alt): New declaration.
+ * libbfd.h: Regenerate.
+ * libcoff-in.h (coff_find_nearest_line_with_alt): New macro.
+ * libcoff.h: Regenerate.
+ * libecoff.h (_bfd_ecoff_find_nearest_line_with_alt): New macro.
+ * mach-o.h (bfd_mach_o_find_nearest_line_with_alt): New macro.
+ * mmo.c (mmo_find_nearest_line_with_alt): New macro.
+ * pef.c (bfd_pef_find_nearest_line_with_alt): New macro.
+ * plugin.c (bfd_plugin_find_nearest_line_with_alt): New macro.
+ * ppcboot.c (ppcboot_find_nearest_line_with_alt): New macro.
+ * som.h (som_find_nearest_line_with_alt): New macro.
+ * srec.c (srec_find_nearest_line_with_alt): New macro.
+ * syms.c (_bfd_nosymbols_find_nearest_line_with_alt): New function.
+ * targets.c (BFD_JUMP_TABLE_SYMBOLS): Add symbol for
+ NAME##_find_nearest_line_with_alt.
+ (_bfd_find_nearest_line_with_alt): Add declaration.
+ * tekhex.c (tekhex_find_nearest_line_with_alt): New macro.
+ * verilog.c (verilog_find_nearest_line_with_alt): New macro.
+ * vms-alpha.c (_bfd_vms_find_nearest_line_with_alt): New macro.
+ * wasm-module.c (wasm_find_nearest_line_with_alt): New macro.
+ * xsym.c (bfd_sym_find_nearest_line_with_alt): New macro.
+
2022-09-02 Frederic Cambus <fred@statdns.com>
* config.bfd (arm-*-openbsd*): Restore target.
diff --git a/bfd/aout-target.h b/bfd/aout-target.h
index bce90f1..1b8c2f1 100644
--- a/bfd/aout-target.h
+++ b/bfd/aout-target.h
@@ -475,6 +475,9 @@ MY_bfd_final_link (bfd *abfd, struct bfd_link_info *info)
#ifndef MY_find_nearest_line
#define MY_find_nearest_line NAME (aout, find_nearest_line)
#endif
+#ifndef MY_find_nearest_line_with_alt
+#define MY_find_nearest_line_with_alt _bfd_nosymbols_find_nearest_line_with_alt
+#endif
#ifndef MY_find_line
#define MY_find_line _bfd_nosymbols_find_line
#endif
diff --git a/bfd/bfd-in2.h b/bfd/bfd-in2.h
index 6aefdd7..79fcc4e 100644
--- a/bfd/bfd-in2.h
+++ b/bfd/bfd-in2.h
@@ -7162,6 +7162,11 @@ bool bfd_set_private_flags (bfd *abfd, flagword flags);
BFD_SEND (abfd, _bfd_find_nearest_line, \
(abfd, syms, sec, off, file, func, line, NULL))
+#define bfd_find_nearest_line_with_alt(abfd, alt_filename, sec, syms, off, \
+ file, func, line, disc) \
+ BFD_SEND (abfd, _bfd_find_nearest_line_with_alt, \
+ (abfd, alt_filename, syms, sec, off, file, func, line, disc))
+
#define bfd_find_nearest_line_discriminator(abfd, sec, syms, off, file, func, \
line, disc) \
BFD_SEND (abfd, _bfd_find_nearest_line, \
@@ -7554,6 +7559,7 @@ typedef struct bfd_target
NAME##_bfd_is_target_special_symbol, \
NAME##_get_lineno, \
NAME##_find_nearest_line, \
+ NAME##_find_nearest_line_with_alt, \
NAME##_find_line, \
NAME##_find_inliner_info, \
NAME##_bfd_make_debug_symbol, \
@@ -7584,6 +7590,11 @@ typedef struct bfd_target
struct bfd_section *, bfd_vma,
const char **, const char **,
unsigned int *, unsigned int *);
+ bool (*_bfd_find_nearest_line_with_alt) (bfd *, const char *,
+ struct bfd_symbol **,
+ struct bfd_section *, bfd_vma,
+ const char **, const char **,
+ unsigned int *, unsigned int *);
bool (*_bfd_find_line) (bfd *, struct bfd_symbol **,
struct bfd_symbol *, const char **,
unsigned int *);
diff --git a/bfd/bfd.c b/bfd/bfd.c
index 5297177..0a21db1 100644
--- a/bfd/bfd.c
+++ b/bfd/bfd.c
@@ -2050,6 +2050,11 @@ DESCRIPTION
. BFD_SEND (abfd, _bfd_find_nearest_line, \
. (abfd, syms, sec, off, file, func, line, NULL))
.
+.#define bfd_find_nearest_line_with_alt(abfd, alt_filename, sec, syms, off, \
+. file, func, line, disc) \
+. BFD_SEND (abfd, _bfd_find_nearest_line_with_alt, \
+. (abfd, alt_filename, syms, sec, off, file, func, line, disc))
+.
.#define bfd_find_nearest_line_discriminator(abfd, sec, syms, off, file, func, \
. line, disc) \
. BFD_SEND (abfd, _bfd_find_nearest_line, \
diff --git a/bfd/binary.c b/bfd/binary.c
index 999d41c..7abf461 100644
--- a/bfd/binary.c
+++ b/bfd/binary.c
@@ -206,6 +206,7 @@ binary_get_symbol_info (bfd *ignore_abfd ATTRIBUTE_UNUSED,
#define binary_bfd_is_local_label_name bfd_generic_is_local_label_name
#define binary_get_lineno _bfd_nosymbols_get_lineno
#define binary_find_nearest_line _bfd_nosymbols_find_nearest_line
+#define binary_find_nearest_line_with_alt _bfd_nosymbols_find_nearest_line_with_alt
#define binary_find_line _bfd_nosymbols_find_line
#define binary_find_inliner_info _bfd_nosymbols_find_inliner_info
#define binary_bfd_make_debug_symbol _bfd_nosymbols_bfd_make_debug_symbol
diff --git a/bfd/coff-rs6000.c b/bfd/coff-rs6000.c
index 3f0753e..bfa999d 100644
--- a/bfd/coff-rs6000.c
+++ b/bfd/coff-rs6000.c
@@ -4409,6 +4409,8 @@ const struct xcoff_dwsect_name xcoff_dwsect_names[] = {
coff_bfd_is_target_special_symbol
#define _bfd_xcoff_get_lineno coff_get_lineno
#define _bfd_xcoff_find_nearest_line coff_find_nearest_line
+#define _bfd_xcoff_find_nearest_line_with_alt \
+coff_find_nearest_line_with_alt
#define _bfd_xcoff_find_line coff_find_line
#define _bfd_xcoff_find_inliner_info coff_find_inliner_info
#define _bfd_xcoff_bfd_make_debug_symbol coff_bfd_make_debug_symbol
diff --git a/bfd/coff64-rs6000.c b/bfd/coff64-rs6000.c
index c5dc95c..fa57910 100644
--- a/bfd/coff64-rs6000.c
+++ b/bfd/coff64-rs6000.c
@@ -2667,6 +2667,7 @@ const bfd_target rs6000_xcoff64_vec =
coff_bfd_is_target_special_symbol,
coff_get_lineno,
coff_find_nearest_line,
+ coff_find_nearest_line_with_alt,
coff_find_line,
coff_find_inliner_info,
coff_bfd_make_debug_symbol,
@@ -2939,6 +2940,7 @@ const bfd_target rs6000_xcoff64_aix_vec =
coff_bfd_is_target_special_symbol,
coff_get_lineno,
coff_find_nearest_line,
+ coff_find_nearest_line_with_alt,
coff_find_line,
coff_find_inliner_info,
coff_bfd_make_debug_symbol,
diff --git a/bfd/dwarf2.c b/bfd/dwarf2.c
index c513ef1..c55a362 100644
--- a/bfd/dwarf2.c
+++ b/bfd/dwarf2.c
@@ -5699,18 +5699,7 @@ _bfd_dwarf2_find_symbol_bias (asymbol ** symbols, void ** pinfo)
return result;
}
-/* Find the source code location of SYMBOL. If SYMBOL is NULL
- then find the nearest source code location corresponding to
- the address SECTION + OFFSET.
- Returns 1 if the line is found without error and fills in
- FILENAME_PTR and LINENUMBER_PTR. In the case where SYMBOL was
- NULL the FUNCTIONNAME_PTR is also filled in.
- Returns 2 if partial information from _bfd_elf_find_function is
- returned (function and maybe file) by looking at symbols. DWARF2
- info is present but not regarding the requested code location.
- Returns 0 otherwise.
- SYMBOLS contains the symbol table for ABFD.
- DEBUG_SECTIONS contains the name of the dwarf debug sections. */
+/* See _bfd_dwarf2_find_nearest_line_with_alt. */
int
_bfd_dwarf2_find_nearest_line (bfd *abfd,
@@ -5725,6 +5714,43 @@ _bfd_dwarf2_find_nearest_line (bfd *abfd,
const struct dwarf_debug_section *debug_sections,
void **pinfo)
{
+ return _bfd_dwarf2_find_nearest_line_with_alt
+ (abfd, NULL, symbols, symbol, section, offset, filename_ptr,
+ functionname_ptr, linenumber_ptr, discriminator_ptr, debug_sections,
+ pinfo);
+}
+
+/* Find the source code location of SYMBOL. If SYMBOL is NULL
+ then find the nearest source code location corresponding to
+ the address SECTION + OFFSET.
+ Returns 1 if the line is found without error and fills in
+ FILENAME_PTR and LINENUMBER_PTR. In the case where SYMBOL was
+ NULL the FUNCTIONNAME_PTR is also filled in.
+ Returns 2 if partial information from _bfd_elf_find_function is
+ returned (function and maybe file) by looking at symbols. DWARF2
+ info is present but not regarding the requested code location.
+ Returns 0 otherwise.
+ SYMBOLS contains the symbol table for ABFD.
+ DEBUG_SECTIONS contains the name of the dwarf debug sections.
+ If ALT_FILENAME is given, attempt to open the file and use it
+ as the .gnu_debugaltlink file. Otherwise this file will be
+ searched for when needed. */
+
+int
+_bfd_dwarf2_find_nearest_line_with_alt
+ (bfd *abfd,
+ const char *alt_filename,
+ asymbol **symbols,
+ asymbol *symbol,
+ asection *section,
+ bfd_vma offset,
+ const char **filename_ptr,
+ const char **functionname_ptr,
+ unsigned int *linenumber_ptr,
+ unsigned int *discriminator_ptr,
+ const struct dwarf_debug_section *debug_sections,
+ void **pinfo)
+{
/* Read each compilation unit from the section .debug_info, and check
to see if it contains the address we are searching for. If yes,
lookup the address, and return the line number info. If no, go
@@ -5755,6 +5781,23 @@ _bfd_dwarf2_find_nearest_line (bfd *abfd,
stash = (struct dwarf2_debug *) *pinfo;
+ if (stash->alt.bfd_ptr == NULL && alt_filename != NULL)
+ {
+ bfd *alt_bfd = bfd_openr (alt_filename, NULL);
+
+ if (alt_bfd == NULL)
+ /* bfd_openr will have set the bfd_error. */
+ return false;
+ if (!bfd_check_format (alt_bfd, bfd_object))
+ {
+ bfd_set_error (bfd_error_wrong_format);
+ bfd_close (alt_bfd);
+ return false;
+ }
+
+ stash->alt.bfd_ptr = alt_bfd;
+ }
+
do_line = symbol != NULL;
if (do_line)
{
diff --git a/bfd/elf-bfd.h b/bfd/elf-bfd.h
index 65bd112..f00f87b 100644
--- a/bfd/elf-bfd.h
+++ b/bfd/elf-bfd.h
@@ -2333,6 +2333,9 @@ extern bool _bfd_elf_set_arch_mach
extern bool _bfd_elf_find_nearest_line
(bfd *, asymbol **, asection *, bfd_vma,
const char **, const char **, unsigned int *, unsigned int *);
+extern bool _bfd_elf_find_nearest_line_with_alt
+ (bfd *, const char *, asymbol **, asection *, bfd_vma,
+ const char **, const char **, unsigned int *, unsigned int *);
extern bool _bfd_elf_find_line
(bfd *, asymbol **, asymbol *, const char **, unsigned int *);
extern bool _bfd_elf_find_inliner_info
diff --git a/bfd/elf.c b/bfd/elf.c
index 8aba36a..1f427e4 100644
--- a/bfd/elf.c
+++ b/bfd/elf.c
@@ -9340,13 +9340,35 @@ _bfd_elf_find_nearest_line (bfd *abfd,
unsigned int *line_ptr,
unsigned int *discriminator_ptr)
{
+ return _bfd_elf_find_nearest_line_with_alt (abfd, NULL, symbols, section,
+ offset, filename_ptr,
+ functionname_ptr, line_ptr,
+ discriminator_ptr);
+}
+
+/* Find the nearest line to a particular section and offset,
+ for error reporting. ALT_BFD representing a .gnu_debugaltlink file
+ can be optionally specified. */
+
+bool
+_bfd_elf_find_nearest_line_with_alt (bfd *abfd,
+ const char *alt_filename,
+ asymbol **symbols,
+ asection *section,
+ bfd_vma offset,
+ const char **filename_ptr,
+ const char **functionname_ptr,
+ unsigned int *line_ptr,
+ unsigned int *discriminator_ptr)
+{
bool found;
- if (_bfd_dwarf2_find_nearest_line (abfd, symbols, NULL, section, offset,
- filename_ptr, functionname_ptr,
- line_ptr, discriminator_ptr,
- dwarf_debug_sections,
- &elf_tdata (abfd)->dwarf2_find_line_info))
+ if (_bfd_dwarf2_find_nearest_line_with_alt (abfd, alt_filename, symbols, NULL,
+ section, offset, filename_ptr,
+ functionname_ptr, line_ptr,
+ discriminator_ptr,
+ dwarf_debug_sections,
+ &elf_tdata (abfd)->dwarf2_find_line_info))
return true;
if (_bfd_dwarf1_find_nearest_line (abfd, symbols, section, offset,
diff --git a/bfd/elf32-mips.c b/bfd/elf32-mips.c
index b611515..3f92df6 100644
--- a/bfd/elf32-mips.c
+++ b/bfd/elf32-mips.c
@@ -2573,6 +2573,8 @@ static const struct ecoff_debug_swap mips_elf32_ecoff_debug_swap = {
_bfd_mips_elf_is_target_special_symbol
#define bfd_elf32_get_synthetic_symtab _bfd_mips_elf_get_synthetic_symtab
#define bfd_elf32_find_nearest_line _bfd_mips_elf_find_nearest_line
+#define bfd_elf32_find_nearest_line_with_alt \
+ _bfd_mips_elf_find_nearest_line_with_alt
#define bfd_elf32_find_inliner_info _bfd_mips_elf_find_inliner_info
#define bfd_elf32_new_section_hook _bfd_mips_elf_new_section_hook
#define bfd_elf32_set_section_contents _bfd_mips_elf_set_section_contents
diff --git a/bfd/elf64-mips.c b/bfd/elf64-mips.c
index c2c6604..e3ee0b9 100644
--- a/bfd/elf64-mips.c
+++ b/bfd/elf64-mips.c
@@ -4792,6 +4792,8 @@ const struct elf_size_info mips_elf64_size_info =
#define bfd_elf64_bfd_is_target_special_symbol \
_bfd_mips_elf_is_target_special_symbol
#define bfd_elf64_find_nearest_line _bfd_mips_elf_find_nearest_line
+#define bfd_elf64_find_nearest_line_with_alt \
+ _bfd_mips_elf_find_nearest_line_with_alt
#define bfd_elf64_find_inliner_info _bfd_mips_elf_find_inliner_info
#define bfd_elf64_new_section_hook _bfd_mips_elf_new_section_hook
#define bfd_elf64_set_section_contents _bfd_mips_elf_set_section_contents
diff --git a/bfd/elfn32-mips.c b/bfd/elfn32-mips.c
index af98454..ac604ed 100644
--- a/bfd/elfn32-mips.c
+++ b/bfd/elfn32-mips.c
@@ -4176,6 +4176,8 @@ static const struct ecoff_debug_swap mips_elf32_ecoff_debug_swap = {
#define bfd_elf32_bfd_is_target_special_symbol \
_bfd_mips_elf_is_target_special_symbol
#define bfd_elf32_find_nearest_line _bfd_mips_elf_find_nearest_line
+#define bfd_elf32_find_nearest_line_with_alt \
+ _bfd_mips_elf_find_nearest_line_with_alt
#define bfd_elf32_find_inliner_info _bfd_mips_elf_find_inliner_info
#define bfd_elf32_new_section_hook _bfd_mips_elf_new_section_hook
#define bfd_elf32_set_section_contents _bfd_mips_elf_set_section_contents
diff --git a/bfd/elfxx-mips.h b/bfd/elfxx-mips.h
index 3be6952..af6d14c 100644
--- a/bfd/elfxx-mips.h
+++ b/bfd/elfxx-mips.h
@@ -92,6 +92,8 @@ extern bool _bfd_mips_elf_is_target_special_symbol
extern bool _bfd_mips_elf_find_nearest_line
(bfd *, asymbol **, asection *, bfd_vma,
const char **, const char **, unsigned int *, unsigned int *);
+#define _bfd_mips_elf_find_nearest_line_with_alt \
+ _bfd_nosymbols_find_nearest_line_with_alt
extern bool _bfd_mips_elf_find_inliner_info
(bfd *, const char **, const char **, unsigned int *);
extern bool _bfd_mips_elf_set_section_contents
diff --git a/bfd/elfxx-target.h b/bfd/elfxx-target.h
index 0579f64..feaba84 100644
--- a/bfd/elfxx-target.h
+++ b/bfd/elfxx-target.h
@@ -52,6 +52,10 @@
#ifndef bfd_elfNN_find_nearest_line
#define bfd_elfNN_find_nearest_line _bfd_elf_find_nearest_line
#endif
+#ifndef bfd_elfNN_find_nearest_line_with_alt
+#define bfd_elfNN_find_nearest_line_with_alt \
+ _bfd_elf_find_nearest_line_with_alt
+#endif
#ifndef bfd_elfNN_find_line
#define bfd_elfNN_find_line _bfd_elf_find_line
#endif
diff --git a/bfd/i386msdos.c b/bfd/i386msdos.c
index 8247828..0f6cdec 100644
--- a/bfd/i386msdos.c
+++ b/bfd/i386msdos.c
@@ -252,6 +252,7 @@ msdos_set_section_contents (bfd *abfd,
#define msdos_get_symbol_version_string \
_bfd_nosymbols_get_symbol_version_string
#define msdos_find_nearest_line _bfd_nosymbols_find_nearest_line
+#define msdos_find_nearest_line_with_alt _bfd_nosymbols_find_nearest_line_with_alt
#define msdos_find_line _bfd_nosymbols_find_line
#define msdos_find_inliner_info _bfd_nosymbols_find_inliner_info
#define msdos_get_lineno _bfd_nosymbols_get_lineno
diff --git a/bfd/ihex.c b/bfd/ihex.c
index cccec8f..3088f7e 100644
--- a/bfd/ihex.c
+++ b/bfd/ihex.c
@@ -942,6 +942,7 @@ ihex_sizeof_headers (bfd *abfd ATTRIBUTE_UNUSED,
#define ihex_bfd_is_local_label_name _bfd_nosymbols_bfd_is_local_label_name
#define ihex_get_lineno _bfd_nosymbols_get_lineno
#define ihex_find_nearest_line _bfd_nosymbols_find_nearest_line
+#define ihex_find_nearest_line_with_alt _bfd_nosymbols_find_nearest_line_with_alt
#define ihex_find_line _bfd_nosymbols_find_line
#define ihex_find_inliner_info _bfd_nosymbols_find_inliner_info
#define ihex_bfd_make_debug_symbol _bfd_nosymbols_bfd_make_debug_symbol
diff --git a/bfd/libbfd-in.h b/bfd/libbfd-in.h
index 2905de8..04f343b 100644
--- a/bfd/libbfd-in.h
+++ b/bfd/libbfd-in.h
@@ -451,6 +451,10 @@ extern bool _bfd_nosymbols_find_nearest_line
(bfd *, asymbol **, asection *, bfd_vma,
const char **, const char **, unsigned int *, unsigned int *)
ATTRIBUTE_HIDDEN;
+extern bool _bfd_nosymbols_find_nearest_line_with_alt
+ (bfd *, const char *, asymbol **, asection *, bfd_vma,
+ const char **, const char **, unsigned int *, unsigned int *)
+ ATTRIBUTE_HIDDEN;
extern bool _bfd_nosymbols_find_line
(bfd *, asymbol **, asymbol *, const char **, unsigned int *)
ATTRIBUTE_HIDDEN;
@@ -586,6 +590,13 @@ extern int _bfd_dwarf2_find_nearest_line
const char **, const char **, unsigned int *, unsigned int *,
const struct dwarf_debug_section *, void **) ATTRIBUTE_HIDDEN;
+/* Find the nearest line using DWARF 2 debugging information, with
+ the option of specifying a .gnu_debugaltlink file. */
+extern int _bfd_dwarf2_find_nearest_line_with_alt
+ (bfd *, const char *, asymbol **, asymbol *, asection *, bfd_vma,
+ const char **, const char **, unsigned int *, unsigned int *,
+ const struct dwarf_debug_section *, void **) ATTRIBUTE_HIDDEN;
+
/* Find the bias between DWARF addresses and real addresses. */
extern bfd_signed_vma _bfd_dwarf2_find_symbol_bias
(asymbol **, void **) ATTRIBUTE_HIDDEN;
diff --git a/bfd/libbfd.h b/bfd/libbfd.h
index c766722..68d0c42 100644
--- a/bfd/libbfd.h
+++ b/bfd/libbfd.h
@@ -456,6 +456,10 @@ extern bool _bfd_nosymbols_find_nearest_line
(bfd *, asymbol **, asection *, bfd_vma,
const char **, const char **, unsigned int *, unsigned int *)
ATTRIBUTE_HIDDEN;
+extern bool _bfd_nosymbols_find_nearest_line_with_alt
+ (bfd *, const char *, asymbol **, asection *, bfd_vma,
+ const char **, const char **, unsigned int *, unsigned int *)
+ ATTRIBUTE_HIDDEN;
extern bool _bfd_nosymbols_find_line
(bfd *, asymbol **, asymbol *, const char **, unsigned int *)
ATTRIBUTE_HIDDEN;
@@ -591,6 +595,13 @@ extern int _bfd_dwarf2_find_nearest_line
const char **, const char **, unsigned int *, unsigned int *,
const struct dwarf_debug_section *, void **) ATTRIBUTE_HIDDEN;
+/* Find the nearest line using DWARF 2 debugging information, with
+ the option of specifying a .gnu_debugaltlink file. */
+extern int _bfd_dwarf2_find_nearest_line_with_alt
+ (bfd *, const char *, asymbol **, asymbol *, asection *, bfd_vma,
+ const char **, const char **, unsigned int *, unsigned int *,
+ const struct dwarf_debug_section *, void **) ATTRIBUTE_HIDDEN;
+
/* Find the bias between DWARF addresses and real addresses. */
extern bfd_signed_vma _bfd_dwarf2_find_symbol_bias
(asymbol **, void **) ATTRIBUTE_HIDDEN;
diff --git a/bfd/libcoff-in.h b/bfd/libcoff-in.h
index e1f9e60..722fd1e 100644
--- a/bfd/libcoff-in.h
+++ b/bfd/libcoff-in.h
@@ -358,6 +358,8 @@ extern asymbol *coff_bfd_make_debug_symbol
extern bool coff_find_nearest_line
(bfd *, asymbol **, asection *, bfd_vma,
const char **, const char **, unsigned int *, unsigned int *);
+#define coff_find_nearest_line_with_alt \
+ _bfd_nosymbols_find_nearest_line_with_alt
#define coff_find_line _bfd_nosymbols_find_line
struct dwarf_debug_section;
extern bool coff_find_nearest_line_with_names
diff --git a/bfd/libcoff.h b/bfd/libcoff.h
index a884a80..21640c1 100644
--- a/bfd/libcoff.h
+++ b/bfd/libcoff.h
@@ -362,6 +362,8 @@ extern asymbol *coff_bfd_make_debug_symbol
extern bool coff_find_nearest_line
(bfd *, asymbol **, asection *, bfd_vma,
const char **, const char **, unsigned int *, unsigned int *);
+#define coff_find_nearest_line_with_alt \
+ _bfd_nosymbols_find_nearest_line_with_alt
#define coff_find_line _bfd_nosymbols_find_line
struct dwarf_debug_section;
extern bool coff_find_nearest_line_with_names
diff --git a/bfd/libecoff.h b/bfd/libecoff.h
index b6c6948..0733777 100644
--- a/bfd/libecoff.h
+++ b/bfd/libecoff.h
@@ -293,6 +293,8 @@ extern bool _bfd_ecoff_bfd_is_local_label_name
extern bool _bfd_ecoff_find_nearest_line
(bfd *, asymbol **, asection *, bfd_vma,
const char **, const char **, unsigned int *, unsigned int *);
+#define _bfd_ecoff_find_nearest_line_with_alt \
+ _bfd_nosymbols_find_nearest_line_with_alt
#define _bfd_ecoff_find_line _bfd_nosymbols_find_line
#define _bfd_ecoff_bfd_make_debug_symbol _bfd_nosymbols_bfd_make_debug_symbol
#define _bfd_ecoff_read_minisymbols _bfd_generic_read_minisymbols
diff --git a/bfd/mach-o.h b/bfd/mach-o.h
index f7418ad..2e9a634 100644
--- a/bfd/mach-o.h
+++ b/bfd/mach-o.h
@@ -729,6 +729,8 @@ bool bfd_mach_o_find_nearest_line (bfd *, asymbol **,
asection *, bfd_vma,
const char **, const char **,
unsigned int *, unsigned int *);
+#define bfd_mach_o_find_nearest_line_with_alt \
+ _bfd_nosymbols_find_nearest_line_with_alt
#define bfd_mach_o_find_line _bfd_nosymbols_find_line
bool bfd_mach_o_close_and_cleanup (bfd *);
bool bfd_mach_o_free_cached_info (bfd *);
diff --git a/bfd/mmo.c b/bfd/mmo.c
index 80b5cb6..fd92a34 100644
--- a/bfd/mmo.c
+++ b/bfd/mmo.c
@@ -3316,6 +3316,7 @@ mmo_write_object_contents (bfd *abfd)
/* FIXME: We can do better on this one, if we have a dwarf2 .debug_line
section or if MMO line numbers are implemented. */
#define mmo_find_nearest_line _bfd_nosymbols_find_nearest_line
+#define mmo_find_nearest_line_with_alt _bfd_nosymbols_find_nearest_line_with_alt
#define mmo_find_line _bfd_nosymbols_find_line
#define mmo_find_inliner_info _bfd_nosymbols_find_inliner_info
#define mmo_make_empty_symbol _bfd_generic_make_empty_symbol
diff --git a/bfd/pef.c b/bfd/pef.c
index 1dcb1da..d9936f7 100644
--- a/bfd/pef.c
+++ b/bfd/pef.c
@@ -41,6 +41,7 @@
#define bfd_pef_bfd_is_target_special_symbol _bfd_bool_bfd_asymbol_false
#define bfd_pef_get_lineno _bfd_nosymbols_get_lineno
#define bfd_pef_find_nearest_line _bfd_nosymbols_find_nearest_line
+#define bfd_pef_find_nearest_line_with_alt _bfd_nosymbols_find_nearest_line_with_alt
#define bfd_pef_find_line _bfd_nosymbols_find_line
#define bfd_pef_find_inliner_info _bfd_nosymbols_find_inliner_info
#define bfd_pef_get_symbol_version_string _bfd_nosymbols_get_symbol_version_string
diff --git a/bfd/plugin.c b/bfd/plugin.c
index c69fbd7..9103e21 100644
--- a/bfd/plugin.c
+++ b/bfd/plugin.c
@@ -83,6 +83,7 @@ dlerror (void)
#define bfd_plugin_bfd_is_target_special_symbol _bfd_bool_bfd_asymbol_false
#define bfd_plugin_get_lineno _bfd_nosymbols_get_lineno
#define bfd_plugin_find_nearest_line _bfd_nosymbols_find_nearest_line
+#define bfd_plugin_find_nearest_line_with_alt _bfd_nosymbols_find_nearest_line_with_alt
#define bfd_plugin_find_line _bfd_nosymbols_find_line
#define bfd_plugin_find_inliner_info _bfd_nosymbols_find_inliner_info
#define bfd_plugin_get_symbol_version_string _bfd_nosymbols_get_symbol_version_string
diff --git a/bfd/ppcboot.c b/bfd/ppcboot.c
index 4e6cc9a..d52d1a6 100644
--- a/bfd/ppcboot.c
+++ b/bfd/ppcboot.c
@@ -332,6 +332,7 @@ ppcboot_get_symbol_info (bfd *ignore_abfd ATTRIBUTE_UNUSED,
#define ppcboot_bfd_is_local_label_name bfd_generic_is_local_label_name
#define ppcboot_get_lineno _bfd_nosymbols_get_lineno
#define ppcboot_find_nearest_line _bfd_nosymbols_find_nearest_line
+#define ppcboot_find_nearest_line_with_alt _bfd_nosymbols_find_nearest_line_with_alt
#define ppcboot_find_line _bfd_nosymbols_find_line
#define ppcboot_find_inliner_info _bfd_nosymbols_find_inliner_info
#define ppcboot_bfd_make_debug_symbol _bfd_nosymbols_bfd_make_debug_symbol
diff --git a/bfd/som.h b/bfd/som.h
index 6aca4a2..68b8cc3 100644
--- a/bfd/som.h
+++ b/bfd/som.h
@@ -230,6 +230,9 @@ struct som_section_data_struct
#define R_HPPA_BEGIN_TRY R_BEGIN_TRY
#define R_HPPA_END_TRY R_END_TRY
+#define som_find_nearest_line_with_alt \
+ _bfd_nosymbols_find_nearest_line_with_alt
+
/* Exported functions, mostly for use by GAS. */
bool bfd_som_set_section_attributes
(asection *, int, int, unsigned int, int);
diff --git a/bfd/srec.c b/bfd/srec.c
index abe36bb..3ef429e 100644
--- a/bfd/srec.c
+++ b/bfd/srec.c
@@ -1249,6 +1249,7 @@ srec_print_symbol (bfd *abfd,
#define srec_bfd_is_local_label_name bfd_generic_is_local_label_name
#define srec_get_lineno _bfd_nosymbols_get_lineno
#define srec_find_nearest_line _bfd_nosymbols_find_nearest_line
+#define srec_find_nearest_line_with_alt _bfd_nosymbols_find_nearest_line_with_alt
#define srec_find_line _bfd_nosymbols_find_line
#define srec_find_inliner_info _bfd_nosymbols_find_inliner_info
#define srec_make_empty_symbol _bfd_generic_make_empty_symbol
diff --git a/bfd/syms.c b/bfd/syms.c
index b284cb2..7a454c5 100644
--- a/bfd/syms.c
+++ b/bfd/syms.c
@@ -1505,6 +1505,21 @@ _bfd_nosymbols_find_nearest_line
}
bool
+_bfd_nosymbols_find_nearest_line_with_alt
+ (bfd *abfd,
+ const char *alt_filename ATTRIBUTE_UNUSED,
+ asymbol **symbols ATTRIBUTE_UNUSED,
+ asection *section ATTRIBUTE_UNUSED,
+ bfd_vma offset ATTRIBUTE_UNUSED,
+ const char **filename_ptr ATTRIBUTE_UNUSED,
+ const char **functionname_ptr ATTRIBUTE_UNUSED,
+ unsigned int *line_ptr ATTRIBUTE_UNUSED,
+ unsigned int *discriminator_ptr ATTRIBUTE_UNUSED)
+{
+ return _bfd_bool_bfd_false_error (abfd);
+}
+
+bool
_bfd_nosymbols_find_line (bfd *abfd,
asymbol **symbols ATTRIBUTE_UNUSED,
asymbol *symbol ATTRIBUTE_UNUSED,
diff --git a/bfd/targets.c b/bfd/targets.c
index 8ad3ef3..1ec8acd 100644
--- a/bfd/targets.c
+++ b/bfd/targets.c
@@ -377,6 +377,7 @@ BFD_JUMP_TABLE macros.
. NAME##_bfd_is_target_special_symbol, \
. NAME##_get_lineno, \
. NAME##_find_nearest_line, \
+. NAME##_find_nearest_line_with_alt, \
. NAME##_find_line, \
. NAME##_find_inliner_info, \
. NAME##_bfd_make_debug_symbol, \
@@ -407,6 +408,11 @@ BFD_JUMP_TABLE macros.
. struct bfd_section *, bfd_vma,
. const char **, const char **,
. unsigned int *, unsigned int *);
+. bool (*_bfd_find_nearest_line_with_alt) (bfd *, const char *,
+. struct bfd_symbol **,
+. struct bfd_section *, bfd_vma,
+. const char **, const char **,
+. unsigned int *, unsigned int *);
. bool (*_bfd_find_line) (bfd *, struct bfd_symbol **,
. struct bfd_symbol *, const char **,
. unsigned int *);
diff --git a/bfd/tekhex.c b/bfd/tekhex.c
index 7ff87af..f2b2db2 100644
--- a/bfd/tekhex.c
+++ b/bfd/tekhex.c
@@ -966,6 +966,7 @@ tekhex_print_symbol (bfd *abfd,
#define tekhex_bfd_is_local_label_name bfd_generic_is_local_label_name
#define tekhex_get_lineno _bfd_nosymbols_get_lineno
#define tekhex_find_nearest_line _bfd_nosymbols_find_nearest_line
+#define tekhex_find_nearest_line_with_alt _bfd_nosymbols_find_nearest_line_with_alt
#define tekhex_find_line _bfd_nosymbols_find_line
#define tekhex_find_inliner_info _bfd_nosymbols_find_inliner_info
#define tekhex_get_symbol_version_string _bfd_nosymbols_get_symbol_version_string
diff --git a/bfd/verilog.c b/bfd/verilog.c
index 4579f05..baf0e04 100644
--- a/bfd/verilog.c
+++ b/bfd/verilog.c
@@ -370,6 +370,7 @@ verilog_mkobject (bfd *abfd)
#define verilog_bfd_is_local_label_name bfd_generic_is_local_label_name
#define verilog_get_lineno _bfd_nosymbols_get_lineno
#define verilog_find_nearest_line _bfd_nosymbols_find_nearest_line
+#define verilog_find_nearest_line_with_alt _bfd_nosymbols_find_nearest_line_with_alt
#define verilog_find_inliner_info _bfd_nosymbols_find_inliner_info
#define verilog_make_empty_symbol _bfd_generic_make_empty_symbol
#define verilog_bfd_make_debug_symbol _bfd_nosymbols_bfd_make_debug_symbol
diff --git a/bfd/vms-alpha.c b/bfd/vms-alpha.c
index 5a867f7..0ea9ed5 100644
--- a/bfd/vms-alpha.c
+++ b/bfd/vms-alpha.c
@@ -9992,6 +9992,8 @@ bfd_vms_get_data (bfd *abfd)
#define alpha_vms_find_inliner_info _bfd_nosymbols_find_inliner_info
#define alpha_vms_bfd_make_debug_symbol _bfd_nosymbols_bfd_make_debug_symbol
#define alpha_vms_find_nearest_line _bfd_vms_find_nearest_line
+#define alpha_vms_find_nearest_line_with_alt \
+ _bfd_nosymbols_find_nearest_line_with_alt
#define alpha_vms_find_line _bfd_nosymbols_find_line
#define alpha_vms_bfd_is_local_label_name vms_bfd_is_local_label_name
diff --git a/bfd/wasm-module.c b/bfd/wasm-module.c
index f6afa05..2c2c6c7 100644
--- a/bfd/wasm-module.c
+++ b/bfd/wasm-module.c
@@ -784,6 +784,7 @@ wasm_object_p (bfd *abfd)
#define wasm_bfd_is_target_special_symbol _bfd_bool_bfd_asymbol_false
#define wasm_get_lineno _bfd_nosymbols_get_lineno
#define wasm_find_nearest_line _bfd_nosymbols_find_nearest_line
+#define wasm_find_nearest_line_with_alt _bfd_nosymbols_find_nearest_line_with_alt
#define wasm_find_line _bfd_nosymbols_find_line
#define wasm_find_inliner_info _bfd_nosymbols_find_inliner_info
#define wasm_bfd_make_debug_symbol _bfd_nosymbols_bfd_make_debug_symbol
diff --git a/bfd/xsym.c b/bfd/xsym.c
index 8a092f0..b8e3d6c 100644
--- a/bfd/xsym.c
+++ b/bfd/xsym.c
@@ -32,6 +32,7 @@
#define bfd_sym_bfd_is_target_special_symbol _bfd_bool_bfd_asymbol_false
#define bfd_sym_get_lineno _bfd_nosymbols_get_lineno
#define bfd_sym_find_nearest_line _bfd_nosymbols_find_nearest_line
+#define bfd_sym_find_nearest_line_with_alt _bfd_nosymbols_find_nearest_line_with_alt
#define bfd_sym_find_line _bfd_nosymbols_find_line
#define bfd_sym_find_inliner_info _bfd_nosymbols_find_inliner_info
#define bfd_sym_get_symbol_version_string _bfd_nosymbols_get_symbol_version_string