diff --git a/tools/hunk/hunk.go b/tools/hunk/hunk.go index 1bbe49ab..952728a5 100644 --- a/tools/hunk/hunk.go +++ b/tools/hunk/hunk.go @@ -39,6 +39,7 @@ const ( EXT_DEF = 1 // relocatable definition EXT_ABS = 2 // Absolute definition EXT_RES = 3 // no longer supported + EXT_GNU_LOCAL = 33 // GNU local symbol definition EXT_REF32 = 129 // 32 bit absolute reference to symbol EXT_COMMON = 130 // 32 bit absolute reference to COMMON block EXT_REF16 = 131 // 16 bit PC-relative reference to symbol @@ -103,6 +104,7 @@ func init() { EXT_DEF: "EXT_DEF", EXT_ABS: "EXT_ABS", EXT_RES: "EXT_RES", + EXT_GNU_LOCAL: "EXT_GNU_LOCAL", EXT_REF32: "EXT_REF32", EXT_COMMON: "EXT_COMMON", EXT_REF16: "EXT_REF16", diff --git a/tools/hunk/hunk_debug.go b/tools/hunk/hunk_debug.go index 8eb634d7..b5a26c40 100644 --- a/tools/hunk/hunk_debug.go +++ b/tools/hunk/hunk_debug.go @@ -45,7 +45,6 @@ func readStrTab(r io.Reader, size uint32) []byte { } func readHunkDebugGnu(r io.Reader, name string) HunkDebugGnu { - fmt.Printf("HunkDebugGnu: %s\n", name) var stabTab []Stab var stabstrTab []byte if name == "" { diff --git a/tools/hunk/hunk_ext.go b/tools/hunk/hunk_ext.go index 122dac12..9186ca89 100644 --- a/tools/hunk/hunk_ext.go +++ b/tools/hunk/hunk_ext.go @@ -29,7 +29,7 @@ func readHunkExt(r io.Reader) HunkExt { extType := ExtType(nlongs >> 24) name := readStringOfSize(r, length) switch extType { - case EXT_DEF, EXT_ABS, EXT_RES: + case EXT_DEF, EXT_ABS, EXT_RES, EXT_GNU_LOCAL: value := readLong(r) ext = append(ext, Extern{extType, name, value, nil}) case EXT_REF32, EXT_REF16, EXT_REF8, EXT_DEXT32, EXT_DEXT16, EXT_DEXT8: @@ -38,7 +38,7 @@ func readHunkExt(r io.Reader) HunkExt { size := readLong(r) ext = append(ext, Extern{extType, name, size, readArrayOfLong(r)}) default: - panic("unknown external type") + panic(fmt.Sprintf("unknown external type: %v", extType)) } } sort.Slice(ext, func(i, j int) bool {