Commit Graph

5 Commits

Author SHA1 Message Date
Iain Sandoe
d1339b519a libbacktrace, Mach-O : Support PowerPC archs.
This adds the PPC architecture variants for Mach-O libbacktrace.

With this (as for X86 and Arm) when dsymutil is run on the binary
we get a basic usable backtrace.

Testsuite results on powerpc-apple-darwin9 are the same as for X86:
 * btest fails (TBC why)
 * dwarf5 tests fail because dsymutil does not handle that so far.

libbacktrace/ChangeLog:

	* macho.c (MACH_O_CPU_TYPE_PPC): New.
	(MACH_O_CPU_TYPE_PPC64): New.
	Add compile-tests for powerpc to the Mach-O variants.
2020-09-16 19:37:28 +01:00
Ian Lance Taylor
a8a7a97b4e libbacktrace: correct memory lengths in Mach-O dsym support
* macho.c (macho_add_dsym): Make space for '/' in dsym.  Use
	correct length when freeing diralc.
2020-09-08 14:51:32 -07:00
Ian Lance Taylor
488e33339e libbacktrace: correctly swap Mach-O 32-bit file offset
libbacktrace/ChangeLog:
	PR libbacktrace/96973
	* macho.c (macho_add_fat): Correctly swap 32-bit file offset.
2020-09-08 13:20:26 -07:00
Ian Lance Taylor
74c176ca2f libbacktrace: add Mach-O 64-bit FAT support
libbacktrace/:
	* macho.c (MACH_O_MH_MAGIC_FAT_64): Define.
	(MACH_O_MH_CIGAM_FAT_64): Define.
	(struct macho_fat_arch_64): Define.
	(macho_add_fat): Add and use is_64 parameter.
	(macho_add): Recognize 64-bit fat files.
2020-08-24 13:10:26 -07:00
Ian Lance Taylor
dea40c941a libbacktrace: add Mach-O support
libbacktrace/
	PR libbacktrace/88745
	* macho.c: New file.
	* filetype.awk: Recognize Mach-O files.
	* Makefile.am (FORMAT_FILES): Add macho.c.
	(check_DATA): New variable.  Set to .dSYM if HAVE_DSYMUTIL.
	(%.dSYM): New pattern target.
	(test_macho_SOURCES, test_macho_CFLAGS): New targets.
	(test_macho_LDADD): New target.
	(BUILDTESTS): Add test_macho.
	(macho.lo): Add dependencies.
	* configure.ac: Recognize macho file type.  Check for
	mach-o/dyld.h.  Don't try to run objcopy if we don't find it.
	Look for dsymutil and define a HAVE_DSYMUTIL conditional.
	* Makefile.in: Regenerate.
	* configure: Regenerate.
	* config.h.in: Regenerate.
2020-05-09 16:09:37 -07:00