[PATCH, libgo] Backport for PPC64 reloc fix to 4.9

Lynn A. Boger laboger@linux.vnet.ibm.com
Tue Dec 30 19:21:00 GMT 2014


Hi,

The following should have been included with the backport for 4.9 in 
https://gcc.gnu.org/ml/gcc-patches/2014-12/msg01383.html to allow the
debuginfo to be read for EM_PPC64.

2014-12-30  Lynn Boger <laboger@linux.vnet.ibm.com>

* libgo/go/debug/elf/file.go:  Read debug_info for EM_PPC64



-------------- next part --------------
Index: libgo/go/debug/elf/file.go
===================================================================
--- libgo/go/debug/elf/file.go	(revision 218817)
+++ libgo/go/debug/elf/file.go	(working copy)
@@ -681,7 +681,7 @@ func (f *File) DWARF() (*dwarf.Data, error) {
 	// If there's a relocation table for .debug_info, we have to process it
 	// now otherwise the data in .debug_info is invalid for x86-64 objects.
 	rela := f.Section(".rela.debug_info")
-	if rela != nil && rela.Type == SHT_RELA && (f.Machine == EM_X86_64 || f.Machine == EM_AARCH64) {
+	if rela != nil && rela.Type == SHT_RELA && (f.Machine == EM_X86_64 || f.Machine == EM_AARCH64 || f.Machine == EM_PPC64) {
 		data, err := rela.Data()
 		if err != nil {
 			return nil, err



More information about the Gcc-patches mailing list