diff --git a/objabi/reloctype/reloctype.1.16.go b/objabi/reloctype/reloctype.1.16.go index 28426ff2..4e2ab1ec 100644 --- a/objabi/reloctype/reloctype.1.16.go +++ b/objabi/reloctype/reloctype.1.16.go @@ -52,6 +52,9 @@ const ( // *rtype, and may be set to zero by the linker if it determines the method // text is unreachable by the linked program. R_METHODOFF = (int)(objabi.R_METHODOFF) + // R_KEEP tells the linker to keep the referred-to symbol in the final binary + // if the symbol containing the R_KEEP relocation is in the final binary. + R_KEEP = (int)(objabi.R_KEEP) // R_ADDRCUOFF resolves to a pointer-sized offset from the start of the // symbol's DWARF compile unit. R_ADDRCUOFF = (int)(objabi.R_ADDRCUOFF) diff --git a/objabi/reloctype/reloctype.1.17.go b/objabi/reloctype/reloctype.1.17.go index e70cfd92..ae33b285 100644 --- a/objabi/reloctype/reloctype.1.17.go +++ b/objabi/reloctype/reloctype.1.17.go @@ -53,6 +53,9 @@ const ( // *rtype, and may be set to zero by the linker if it determines the method // text is unreachable by the linked program. R_METHODOFF = (int)(objabi.R_METHODOFF) + // R_KEEP tells the linker to keep the referred-to symbol in the final binary + // if the symbol containing the R_KEEP relocation is in the final binary. + R_KEEP = (int)(objabi.R_KEEP) R_GOTPCREL = (int)(objabi.R_GOTPCREL) @@ -70,6 +73,7 @@ const ( const ( //not used, only adapter golang higher version + R_INITORDER = 0x10000000 - 9 R_ARM64_PCREL_LDST8 = 0x10000000 - 8 R_ARM64_PCREL_LDST16 = 0x10000000 - 7 diff --git a/objabi/reloctype/reloctype.1.20.go b/objabi/reloctype/reloctype.1.20.go index e575d645..76207d45 100644 --- a/objabi/reloctype/reloctype.1.20.go +++ b/objabi/reloctype/reloctype.1.20.go @@ -53,7 +53,9 @@ const ( // *rtype, and may be set to zero by the linker if it determines the method // text is unreachable by the linked program. R_METHODOFF = (int)(objabi.R_METHODOFF) - + // R_KEEP tells the linker to keep the referred-to symbol in the final binary + // if the symbol containing the R_KEEP relocation is in the final binary. + R_KEEP = (int)(objabi.R_KEEP) // R_ADDRCUOFF resolves to a pointer-sized offset from the start of the // symbol's DWARF compile unit. R_ADDRCUOFF = (int)(objabi.R_ADDRCUOFF) diff --git a/objabi/reloctype/reloctype.1.21.go b/objabi/reloctype/reloctype.1.21.go index b2821499..51e3f54b 100644 --- a/objabi/reloctype/reloctype.1.21.go +++ b/objabi/reloctype/reloctype.1.21.go @@ -53,6 +53,9 @@ const ( // *rtype, and may be set to zero by the linker if it determines the method // text is unreachable by the linked program. R_METHODOFF = (int)(objabi.R_METHODOFF) + // R_KEEP tells the linker to keep the referred-to symbol in the final binary + // if the symbol containing the R_KEEP relocation is in the final binary. + R_KEEP = (int)(objabi.R_KEEP) // R_ADDRCUOFF resolves to a pointer-sized offset from the start of the // symbol's DWARF compile unit. diff --git a/objabi/reloctype/reloctype.1.8.go b/objabi/reloctype/reloctype.1.8.go index 03ec83e0..a416ead8 100644 --- a/objabi/reloctype/reloctype.1.8.go +++ b/objabi/reloctype/reloctype.1.8.go @@ -49,6 +49,7 @@ const ( const ( //not used, only adapter golang higher version + R_KEEP = 0x10000000 - 10 R_INITORDER = 0x10000000 - 9 R_ARM64_PCREL_LDST8 = 0x10000000 - 8 R_ARM64_PCREL_LDST16 = 0x10000000 - 7 diff --git a/objabi/reloctype/reloctype.1.9.go b/objabi/reloctype/reloctype.1.9.go index d682aaf7..c4a43b6f 100644 --- a/objabi/reloctype/reloctype.1.9.go +++ b/objabi/reloctype/reloctype.1.9.go @@ -49,6 +49,7 @@ const ( const ( //not used, only adapter golang higher version + R_KEEP = 0x10000000 - 10 R_INITORDER = 0x10000000 - 9 R_ARM64_PCREL_LDST8 = 0x10000000 - 8 R_ARM64_PCREL_LDST16 = 0x10000000 - 7 diff --git a/register.go b/register.go index 2698e5cf..de360b06 100644 --- a/register.go +++ b/register.go @@ -26,7 +26,7 @@ func typelinksRegister(symPtr map[string]uintptr) { if int(f.funcoff) < len(md.pclntable) { _func := (*_func)(unsafe.Pointer(&(md.pclntable[f.funcoff]))) name := getfuncname(_func, &md) - if !strings.HasPrefix(name, constants.TypeDoubleDotPrefix) && name != EmptyString { + if name != EmptyString { if _, ok := symPtr[name]; !ok { symPtr[name] = getfuncentry(_func, md.text) } diff --git a/relocate.go b/relocate.go index 688833dc..0271f6d8 100644 --- a/relocate.go +++ b/relocate.go @@ -332,6 +332,8 @@ func (linker *Linker) relocate(codeModule *CodeModule, symbolMap, symPtr map[str reloctype.R_ADDRCUOFF, reloctype.R_INITORDER: //nothing todo + case reloctype.R_KEEP: + //nothing todo default: err = fmt.Errorf("unknown reloc type:%s sym:%s", reloctype.RelocTypeString(loc.Type), loc.SymName) }