Commit Graph

12 Commits

Author SHA1 Message Date
Tom de Vries 9ad458d539 [libbacktrace] Add altlink field to struct dwarf_data
Add an altlink field to struct dwarf_data, and initialize it with the pointer
to the struct dwarf_data for the .gnu_debugaltlink.

2019-01-17  Tom de Vries  <tdevries@suse.de>

	* dwarf.c (struct dwarf_data): Add altlink field.
	(backtrace_dwarf_add): Add and handle fileline_altlink parameter.
	* elf.c	(elf_add): Add argument to backtrace_dwarf_add call.
	(phdr_callback, backtrace_initialize): Add argument to elf_add calls.
	* internal.h (backtrace_dwarf_add): Add fileline_altlink parameter.
	* pecoff.c (coff_add): Add argument to backtrace_dwarf_add call.
	* xcoff.c (xcoff_add): Same.

From-SVN: r267994
2019-01-17 00:07:43 +00:00
Tom de Vries e6f00c83f4 [libbacktrace] Return struct dwarf_data pointer from elf_add
Allow the caller of elf_add access to the struct dwarf_data pointer
corresponding to the added elf.

2019-01-17  Tom de Vries  <tdevries@suse.de>

	* internal.h (backtrace_dwarf_add): Add fileline_entry parameter.
	* dwarf.c (backtrace_dwarf_add): Add and handle fileline_entry parameter.
	* elf.c	(elf_add): Add and handle fileline_entry parameter.  Add
	argument to backtrace_dwarf_add call.
	(phdr_callback, backtrace_initialize): Add argument to elf_add calls.
	* pecoff.c (coff_add): Add argument to backtrace_dwarf_add call.
	* xcoff.c (xcoff_add): Same.

From-SVN: r267993
2019-01-17 00:07:32 +00:00
Jakub Jelinek a554497024 Update copyright years.
From-SVN: r267494
2019-01-01 13:31:55 +01:00
Tony Reix ca9a1314ec xcoff.c (struct xcoff_line, [...]): Remove.
* xcoff.c (struct xcoff_line, struct xcoff_line_vector): Remove.
	(struct xcoff_func, struct xcoff_func_vector): New structs.
	(xcoff_syminfo): Drop leading dot from symbol name.
	(xcoff_line_compare, xcoff_line_search): Remove.
	(xcoff_func_compare, xcoff_func_search): New static functions.
	(xcoff_lookup_pc): Search function table.
	(xcoff_add_line, xcoff_process_linenos): Remove.
	(xcoff_initialize_fileline): Build function table.

From-SVN: r263238
2018-08-01 21:55:05 +00:00
Tony Reix 47c699f52a xcoff.c (xcoff_incl_compare): New function.
* xcoff.c (xcoff_incl_compare): New function.
	(xcoff_incl_search): New function.
	(xcoff_process_linenos): Use bsearch to find include file.
	(xcoff_initialize_fileline): Sort include file information.

From-SVN: r256895
2018-01-19 17:45:24 +00:00
Jakub Jelinek 85ec4feb11 Update copyright years.
From-SVN: r256169
2018-01-03 11:03:58 +01:00
Tony Reix e90c74f598 xcoff.c: Initial support for DWARF debug sections in XCOFF.
* xcoff.c: Initial support for DWARF debug sections in XCOFF.
	(STYP_DWARF, SSUBTYP_DW*): Define.
	(enum dwarf_section): Define.
	(struct dwsect_info): Define.
	(xcoff_add): Look for DWARF sections, pass them to
	backtrace_dwarf_add.

From-SVN: r253297
2017-09-29 16:37:39 +00:00
Ian Lance Taylor 9283471ba0 re PR sanitizer/77631 (no symbols in backtrace shown by ASan when debug info is split)
PR sanitizer/77631
	Support for external debug info.
	* elf.c: Include <errno.h>, <sys/stat.h>, <unistd.h>.
	(S_ISLNK): Define if not defined.
	(xstrnlen): Define if strnlen is not available.
	(b_elf_note): Define type.
	(NT_GNU_BUILD_ID): Define macro.
	(elf_crc32, elf_crc32_file): New static functions.
	(elf_is_symlink, elf_readlink): New static functions.
	(elf_open_debugfile_by_buildid): New static function.
	(elf_try_debugfile): New static function.
	(elf_find_debugfile_by_debuglink): New static function.
	(elf_open_debugfile_by_debuglink): New static function.
	(elf_add): Add filename and debuginfo parameters.  Adjust all
	callers.  Look for external debug info notes, and try to fetch
	debug info from external file.
	(struct phdr_data): Add exe_filename field.
	(phdr_callback): Pass filename to elf_add.
	(backtrace_initialize): Add filename parameter.
	* internal.h (backtrace_initialize): Add filename parameter.
	* fileline.c (fileline_initialize): Pass filename to
	backtrace_initialize.
	* pecoff.c (fileline_initialize): Add unused filename parameter.
	* unknown.c (fileline_initialize): Likewise.
	* xcoff.c (fileline_initialize): Likewise.
	* configure.ac: Check for objcopy --add-gnu-debuglink.
	* Makefile.am (dtest): New test target.
	* configure, Makefile.in: Rebuild.

Co-Authored-By: Denis Khalikov <d.khalikov@partner.samsung.com>

From-SVN: r253032
2017-09-20 21:09:37 +00:00
David Edelsohn 2e6af1b892 * xcoff.c (xcoff_process_linenos): Initialize incl to NULL.
From-SVN: r250824
2017-08-02 08:44:54 -04:00
Tony Reix afce7debdc * xcoff.c: Don't leak a file descriptor if an archive is malformed.
From-SVN: r250684
2017-07-28 18:52:13 +00:00
Tony Reix 7e2a8417f7 configure.ac: Check for XCOFF32/XCOFF64.
* configure.ac: Check for XCOFF32/XCOFF64.  Check for loadquery.
	* filetype.awk: Separate AIX XCOFF32 and XCOFF64.
	* xcoff.c: Add support for AIX XCOFF32 and XCOFF64 formats.
	* configure, config.h.in: Regenerate.

From-SVN: r250590
2017-07-26 21:43:28 +00:00
Tony Reix b3530b946f filetype.awk: Add AIX XCOFF type detection.
* filetype.awk: Add AIX XCOFF type detection.
	* configure.ac: Recognize xcoff format.
	* Makefile.am (FORMAT_FILES): Add xcoff.c.
	* fileline.c: Include <unistd.h>.
	(fileline_initialize): Add case for AIX procfs.
	* xcoff.c: New file.
	* configure, Makefile.in: Rebuild.

From-SVN: r250435
2017-07-21 18:05:08 +00:00