debug/elf: adjust version API per issue discussion

This updates the new version API for the discussion on #63952.

Note that the current tests do not have symbols with hidden versions.
Leaving that for later.

For #63952

Change-Id: I1ad4b1e485429a216ba8e5b68f7f4299d120628f
Reviewed-on: https://go-review.googlesource.com/c/go/+/637235
Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: Austin Clements <austin@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Commit-Queue: Ian Lance Taylor <iant@google.com>
This commit is contained in:
Ian Lance Taylor 2024-12-17 11:31:17 -08:00 committed by Gopher Robot
parent b2c0168893
commit 95b433eed4
4 changed files with 468 additions and 467 deletions

View File

@ -106,16 +106,6 @@ pkg debug/elf, const VER_FLG_INFO = 4 #63952
pkg debug/elf, const VER_FLG_INFO DynamicVersionFlag #63952 pkg debug/elf, const VER_FLG_INFO DynamicVersionFlag #63952
pkg debug/elf, const VER_FLG_WEAK = 2 #63952 pkg debug/elf, const VER_FLG_WEAK = 2 #63952
pkg debug/elf, const VER_FLG_WEAK DynamicVersionFlag #63952 pkg debug/elf, const VER_FLG_WEAK DynamicVersionFlag #63952
pkg debug/elf, const VersionScopeGlobal = 2 #63952
pkg debug/elf, const VersionScopeGlobal SymbolVersionScope #63952
pkg debug/elf, const VersionScopeHidden = 4 #63952
pkg debug/elf, const VersionScopeHidden SymbolVersionScope #63952
pkg debug/elf, const VersionScopeLocal = 1 #63952
pkg debug/elf, const VersionScopeLocal SymbolVersionScope #63952
pkg debug/elf, const VersionScopeNone = 0 #63952
pkg debug/elf, const VersionScopeNone SymbolVersionScope #63952
pkg debug/elf, const VersionScopeSpecific = 3 #63952
pkg debug/elf, const VersionScopeSpecific SymbolVersionScope #63952
pkg debug/elf, method (*File) DynamicVersionNeeds() ([]DynamicVersionNeed, error) #63952 pkg debug/elf, method (*File) DynamicVersionNeeds() ([]DynamicVersionNeed, error) #63952
pkg debug/elf, method (*File) DynamicVersions() ([]DynamicVersion, error) #63952 pkg debug/elf, method (*File) DynamicVersions() ([]DynamicVersion, error) #63952
pkg debug/elf, type DynamicVersion struct #63952 pkg debug/elf, type DynamicVersion struct #63952
@ -131,9 +121,11 @@ pkg debug/elf, type DynamicVersionFlag uint16 #63952
pkg debug/elf, type DynamicVersionNeed struct #63952 pkg debug/elf, type DynamicVersionNeed struct #63952
pkg debug/elf, type DynamicVersionNeed struct, Name string #63952 pkg debug/elf, type DynamicVersionNeed struct, Name string #63952
pkg debug/elf, type DynamicVersionNeed struct, Needs []DynamicVersionDep #63952 pkg debug/elf, type DynamicVersionNeed struct, Needs []DynamicVersionDep #63952
pkg debug/elf, type Symbol struct, VersionScope SymbolVersionScope #63952 pkg debug/elf, type Symbol struct, HasVersion bool #63952
pkg debug/elf, type Symbol struct, VersionIndex int16 #63952 pkg debug/elf, type Symbol struct, VersionIndex VersionIndex #63952
pkg debug/elf, type SymbolVersionScope uint8 #63952 pkg debug/elf, method (VersionIndex) Index() uint16 #63952
pkg debug/elf, method (VersionIndex) IsHidden() bool #63952
pkg debug/elf, type VersionIndex uint16 #63952
pkg encoding, type BinaryAppender interface { AppendBinary } #62384 pkg encoding, type BinaryAppender interface { AppendBinary } #62384
pkg encoding, type BinaryAppender interface, AppendBinary([]uint8) ([]uint8, error) #62384 pkg encoding, type BinaryAppender interface, AppendBinary([]uint8) ([]uint8, error) #62384
pkg encoding, type TextAppender interface { AppendText } #62384 pkg encoding, type TextAppender interface { AppendText } #62384

View File

@ -209,22 +209,13 @@ type Symbol struct {
Name string Name string
Info, Other byte Info, Other byte
// VersionScope describes the version in which the symbol is defined. // HasVersion reports whether the symbol has any version information.
// This is only set for the dynamic symbol table. // This will only be true for the dynamic symbol table.
// When no symbol versioning information is available, HasVersion bool
// this is VersionScopeNone. // VersionIndex is the symbol's version index.
VersionScope SymbolVersionScope // Use the methods of the [VersionIndex] type to access it.
// VersionIndex is the version index. // This field is only meaningful if HasVersion is true.
// This is only set if VersionScope is VersionScopeSpecific or VersionIndex VersionIndex
// VersionScopeHidden. This is only set for the dynamic symbol table.
// This index will match either [DynamicVersion.Index]
// in the slice returned by [File.DynamicVersions],
// or [DynamicVersiondep.Index] in the Needs field
// of the elements of the slice returned by [File.DynamicVersionNeeds].
// In general, a defined symbol will have an index referring
// to DynamicVersions, and an undefined symbol will have an index
// referring to some version in DynamicVersionNeeds.
VersionIndex int16
Section SectionIndex Section SectionIndex
Value, Size uint64 Value, Size uint64
@ -678,7 +669,6 @@ func (f *File) getSymbols32(typ SectionType) ([]Symbol, []byte, error) {
symbols[i].Name = str symbols[i].Name = str
symbols[i].Info = sym.Info symbols[i].Info = sym.Info
symbols[i].Other = sym.Other symbols[i].Other = sym.Other
symbols[i].VersionIndex = -1
symbols[i].Section = SectionIndex(sym.Shndx) symbols[i].Section = SectionIndex(sym.Shndx)
symbols[i].Value = uint64(sym.Value) symbols[i].Value = uint64(sym.Value)
symbols[i].Size = uint64(sym.Size) symbols[i].Size = uint64(sym.Size)
@ -726,7 +716,6 @@ func (f *File) getSymbols64(typ SectionType) ([]Symbol, []byte, error) {
symbols[i].Name = str symbols[i].Name = str
symbols[i].Info = sym.Info symbols[i].Info = sym.Info
symbols[i].Other = sym.Other symbols[i].Other = sym.Other
symbols[i].VersionIndex = -1
symbols[i].Section = SectionIndex(sym.Shndx) symbols[i].Section = SectionIndex(sym.Shndx)
symbols[i].Value = sym.Value symbols[i].Value = sym.Value
symbols[i].Size = sym.Size symbols[i].Size = sym.Size
@ -1473,7 +1462,7 @@ func (f *File) DynamicSymbols() ([]Symbol, error) {
} }
if hasVersions { if hasVersions {
for i := range sym { for i := range sym {
sym[i].VersionIndex, sym[i].Version, sym[i].Library, sym[i].VersionScope = f.gnuVersion(i) sym[i].HasVersion, sym[i].VersionIndex, sym[i].Version, sym[i].Library = f.gnuVersion(i)
} }
} }
return sym, nil return sym, nil
@ -1502,23 +1491,37 @@ func (f *File) ImportedSymbols() ([]ImportedSymbol, error) {
if ST_BIND(s.Info) == STB_GLOBAL && s.Section == SHN_UNDEF { if ST_BIND(s.Info) == STB_GLOBAL && s.Section == SHN_UNDEF {
all = append(all, ImportedSymbol{Name: s.Name}) all = append(all, ImportedSymbol{Name: s.Name})
sym := &all[len(all)-1] sym := &all[len(all)-1]
_, sym.Version, sym.Library, _ = f.gnuVersion(i) _, _, sym.Version, sym.Library = f.gnuVersion(i)
} }
} }
return all, nil return all, nil
} }
// SymbolVersionScope describes the version in which a [Symbol] is defined. // VersionIndex is the type of a [Symbol] version index.
// This is only used for the dynamic symbol table. type VersionIndex uint16
type SymbolVersionScope byte
const ( // IsHidden reports whether the symbol is hidden within the version.
VersionScopeNone SymbolVersionScope = iota // no symbol version available // This means that the symbol can only be seen by specifying the exact version.
VersionScopeLocal // symbol has local scope func (vi VersionIndex) IsHidden() bool {
VersionScopeGlobal // symbol has global scope and is in the base version return vi&0x8000 != 0
VersionScopeSpecific // symbol has global scope and is in the version given by VersionIndex }
VersionScopeHidden // symbol is in the version given by VersionIndex, and is hidden
) // Index returns the version index.
// If this is the value 0, it means that the symbol is local,
// and is not visible externally.
// If this is the value 1, it means that the symbol is in the base version,
// and has no specific version; it may or may not match a
// [DynamicVersion.Index] in the slice returned by [File.DynamicVersions].
// Other values will match either [DynamicVersion.Index]
// in the slice returned by [File.DynamicVersions],
// or [DynamicVersionDep.Index] in the Needs field
// of the elements of the slice returned by [File.DynamicVersionNeeds].
// In general, a defined symbol will have an index referring
// to DynamicVersions, and an undefined symbol will have an index
// referring to some version in DynamicVersionNeeds.
func (vi VersionIndex) Index() uint16 {
return uint16(vi & 0x7fff)
}
// DynamicVersion is a version defined by a dynamic object. // DynamicVersion is a version defined by a dynamic object.
// This describes entries in the ELF SHT_GNU_verdef section. // This describes entries in the ELF SHT_GNU_verdef section.
@ -1752,45 +1755,38 @@ func (f *File) gnuVersionInit(str []byte) (bool, error) {
// gnuVersion adds Library and Version information to sym, // gnuVersion adds Library and Version information to sym,
// which came from offset i of the symbol table. // which came from offset i of the symbol table.
func (f *File) gnuVersion(i int) (versionIndex int16, version string, library string, versionFlags SymbolVersionScope) { func (f *File) gnuVersion(i int) (hasVersion bool, versionIndex VersionIndex, version string, library string) {
// Each entry is two bytes; skip undef entry at beginning. // Each entry is two bytes; skip undef entry at beginning.
i = (i + 1) * 2 i = (i + 1) * 2
if i >= len(f.gnuVersym) { if i >= len(f.gnuVersym) {
return -1, "", "", VersionScopeNone return false, 0, "", ""
} }
s := f.gnuVersym[i:] s := f.gnuVersym[i:]
if len(s) < 2 { if len(s) < 2 {
return -1, "", "", VersionScopeNone return false, 0, "", ""
} }
j := int32(f.ByteOrder.Uint16(s)) vi := VersionIndex(f.ByteOrder.Uint16(s))
ndx := int16(j & 0x7fff) ndx := vi.Index()
if j == 0 { if ndx == 0 || ndx == 1 {
return ndx, "", "", VersionScopeLocal return true, vi, "", ""
} else if j == 1 {
return ndx, "", "", VersionScopeGlobal
}
scope := VersionScopeSpecific
if j&0x8000 != 0 {
scope = VersionScopeHidden
} }
for _, v := range f.dynVerNeeds { for _, v := range f.dynVerNeeds {
for _, n := range v.Needs { for _, n := range v.Needs {
if uint16(ndx) == n.Index { if ndx == n.Index {
return ndx, n.Dep, v.Name, scope return true, vi, n.Dep, v.Name
} }
} }
} }
for _, v := range f.dynVers { for _, v := range f.dynVers {
if uint16(ndx) == v.Index { if ndx == v.Index {
return ndx, v.Name, "", scope return true, vi, v.Name, ""
} }
} }
return -1, "", "", VersionScopeNone return false, 0, "", ""
} }
// ImportedLibraries returns the names of all libraries // ImportedLibraries returns the names of all libraries

View File

@ -78,80 +78,80 @@ var fileTests = []fileTest{
}, },
[]string{"libc.so.6"}, []string{"libc.so.6"},
[]Symbol{ []Symbol{
{"", 3, 0, VersionScopeNone, -1, 1, 134512852, 0, "", ""}, {"", 3, 0, false, 0, 1, 134512852, 0, "", ""},
{"", 3, 0, VersionScopeNone, -1, 2, 134512876, 0, "", ""}, {"", 3, 0, false, 0, 2, 134512876, 0, "", ""},
{"", 3, 0, VersionScopeNone, -1, 3, 134513020, 0, "", ""}, {"", 3, 0, false, 0, 3, 134513020, 0, "", ""},
{"", 3, 0, VersionScopeNone, -1, 4, 134513292, 0, "", ""}, {"", 3, 0, false, 0, 4, 134513292, 0, "", ""},
{"", 3, 0, VersionScopeNone, -1, 5, 134513480, 0, "", ""}, {"", 3, 0, false, 0, 5, 134513480, 0, "", ""},
{"", 3, 0, VersionScopeNone, -1, 6, 134513512, 0, "", ""}, {"", 3, 0, false, 0, 6, 134513512, 0, "", ""},
{"", 3, 0, VersionScopeNone, -1, 7, 134513532, 0, "", ""}, {"", 3, 0, false, 0, 7, 134513532, 0, "", ""},
{"", 3, 0, VersionScopeNone, -1, 8, 134513612, 0, "", ""}, {"", 3, 0, false, 0, 8, 134513612, 0, "", ""},
{"", 3, 0, VersionScopeNone, -1, 9, 134513996, 0, "", ""}, {"", 3, 0, false, 0, 9, 134513996, 0, "", ""},
{"", 3, 0, VersionScopeNone, -1, 10, 134514008, 0, "", ""}, {"", 3, 0, false, 0, 10, 134514008, 0, "", ""},
{"", 3, 0, VersionScopeNone, -1, 11, 134518268, 0, "", ""}, {"", 3, 0, false, 0, 11, 134518268, 0, "", ""},
{"", 3, 0, VersionScopeNone, -1, 12, 134518280, 0, "", ""}, {"", 3, 0, false, 0, 12, 134518280, 0, "", ""},
{"", 3, 0, VersionScopeNone, -1, 13, 134518284, 0, "", ""}, {"", 3, 0, false, 0, 13, 134518284, 0, "", ""},
{"", 3, 0, VersionScopeNone, -1, 14, 134518436, 0, "", ""}, {"", 3, 0, false, 0, 14, 134518436, 0, "", ""},
{"", 3, 0, VersionScopeNone, -1, 15, 134518444, 0, "", ""}, {"", 3, 0, false, 0, 15, 134518444, 0, "", ""},
{"", 3, 0, VersionScopeNone, -1, 16, 134518452, 0, "", ""}, {"", 3, 0, false, 0, 16, 134518452, 0, "", ""},
{"", 3, 0, VersionScopeNone, -1, 17, 134518456, 0, "", ""}, {"", 3, 0, false, 0, 17, 134518456, 0, "", ""},
{"", 3, 0, VersionScopeNone, -1, 18, 134518484, 0, "", ""}, {"", 3, 0, false, 0, 18, 134518484, 0, "", ""},
{"", 3, 0, VersionScopeNone, -1, 19, 0, 0, "", ""}, {"", 3, 0, false, 0, 19, 0, 0, "", ""},
{"", 3, 0, VersionScopeNone, -1, 20, 0, 0, "", ""}, {"", 3, 0, false, 0, 20, 0, 0, "", ""},
{"", 3, 0, VersionScopeNone, -1, 21, 0, 0, "", ""}, {"", 3, 0, false, 0, 21, 0, 0, "", ""},
{"", 3, 0, VersionScopeNone, -1, 22, 0, 0, "", ""}, {"", 3, 0, false, 0, 22, 0, 0, "", ""},
{"", 3, 0, VersionScopeNone, -1, 23, 0, 0, "", ""}, {"", 3, 0, false, 0, 23, 0, 0, "", ""},
{"", 3, 0, VersionScopeNone, -1, 24, 0, 0, "", ""}, {"", 3, 0, false, 0, 24, 0, 0, "", ""},
{"", 3, 0, VersionScopeNone, -1, 25, 0, 0, "", ""}, {"", 3, 0, false, 0, 25, 0, 0, "", ""},
{"", 3, 0, VersionScopeNone, -1, 26, 0, 0, "", ""}, {"", 3, 0, false, 0, 26, 0, 0, "", ""},
{"", 3, 0, VersionScopeNone, -1, 27, 0, 0, "", ""}, {"", 3, 0, false, 0, 27, 0, 0, "", ""},
{"", 3, 0, VersionScopeNone, -1, 28, 0, 0, "", ""}, {"", 3, 0, false, 0, 28, 0, 0, "", ""},
{"", 3, 0, VersionScopeNone, -1, 29, 0, 0, "", ""}, {"", 3, 0, false, 0, 29, 0, 0, "", ""},
{"crt1.c", 4, 0, VersionScopeNone, -1, 65521, 0, 0, "", ""}, {"crt1.c", 4, 0, false, 0, 65521, 0, 0, "", ""},
{"/usr/src/lib/csu/i386-elf/crti.S", 4, 0, VersionScopeNone, -1, 65521, 0, 0, "", ""}, {"/usr/src/lib/csu/i386-elf/crti.S", 4, 0, false, 0, 65521, 0, 0, "", ""},
{"<command line>", 4, 0, VersionScopeNone, -1, 65521, 0, 0, "", ""}, {"<command line>", 4, 0, false, 0, 65521, 0, 0, "", ""},
{"<built-in>", 4, 0, VersionScopeNone, -1, 65521, 0, 0, "", ""}, {"<built-in>", 4, 0, false, 0, 65521, 0, 0, "", ""},
{"/usr/src/lib/csu/i386-elf/crti.S", 4, 0, VersionScopeNone, -1, 65521, 0, 0, "", ""}, {"/usr/src/lib/csu/i386-elf/crti.S", 4, 0, false, 0, 65521, 0, 0, "", ""},
{"crtstuff.c", 4, 0, VersionScopeNone, -1, 65521, 0, 0, "", ""}, {"crtstuff.c", 4, 0, false, 0, 65521, 0, 0, "", ""},
{"__CTOR_LIST__", 1, 0, VersionScopeNone, -1, 14, 134518436, 0, "", ""}, {"__CTOR_LIST__", 1, 0, false, 0, 14, 134518436, 0, "", ""},
{"__DTOR_LIST__", 1, 0, VersionScopeNone, -1, 15, 134518444, 0, "", ""}, {"__DTOR_LIST__", 1, 0, false, 0, 15, 134518444, 0, "", ""},
{"__EH_FRAME_BEGIN__", 1, 0, VersionScopeNone, -1, 12, 134518280, 0, "", ""}, {"__EH_FRAME_BEGIN__", 1, 0, false, 0, 12, 134518280, 0, "", ""},
{"__JCR_LIST__", 1, 0, VersionScopeNone, -1, 16, 134518452, 0, "", ""}, {"__JCR_LIST__", 1, 0, false, 0, 16, 134518452, 0, "", ""},
{"p.0", 1, 0, VersionScopeNone, -1, 11, 134518276, 0, "", ""}, {"p.0", 1, 0, false, 0, 11, 134518276, 0, "", ""},
{"completed.1", 1, 0, VersionScopeNone, -1, 18, 134518484, 1, "", ""}, {"completed.1", 1, 0, false, 0, 18, 134518484, 1, "", ""},
{"__do_global_dtors_aux", 2, 0, VersionScopeNone, -1, 8, 134513760, 0, "", ""}, {"__do_global_dtors_aux", 2, 0, false, 0, 8, 134513760, 0, "", ""},
{"object.2", 1, 0, VersionScopeNone, -1, 18, 134518488, 24, "", ""}, {"object.2", 1, 0, false, 0, 18, 134518488, 24, "", ""},
{"frame_dummy", 2, 0, VersionScopeNone, -1, 8, 134513836, 0, "", ""}, {"frame_dummy", 2, 0, false, 0, 8, 134513836, 0, "", ""},
{"crtstuff.c", 4, 0, VersionScopeNone, -1, 65521, 0, 0, "", ""}, {"crtstuff.c", 4, 0, false, 0, 65521, 0, 0, "", ""},
{"__CTOR_END__", 1, 0, VersionScopeNone, -1, 14, 134518440, 0, "", ""}, {"__CTOR_END__", 1, 0, false, 0, 14, 134518440, 0, "", ""},
{"__DTOR_END__", 1, 0, VersionScopeNone, -1, 15, 134518448, 0, "", ""}, {"__DTOR_END__", 1, 0, false, 0, 15, 134518448, 0, "", ""},
{"__FRAME_END__", 1, 0, VersionScopeNone, -1, 12, 134518280, 0, "", ""}, {"__FRAME_END__", 1, 0, false, 0, 12, 134518280, 0, "", ""},
{"__JCR_END__", 1, 0, VersionScopeNone, -1, 16, 134518452, 0, "", ""}, {"__JCR_END__", 1, 0, false, 0, 16, 134518452, 0, "", ""},
{"__do_global_ctors_aux", 2, 0, VersionScopeNone, -1, 8, 134513960, 0, "", ""}, {"__do_global_ctors_aux", 2, 0, false, 0, 8, 134513960, 0, "", ""},
{"/usr/src/lib/csu/i386-elf/crtn.S", 4, 0, VersionScopeNone, -1, 65521, 0, 0, "", ""}, {"/usr/src/lib/csu/i386-elf/crtn.S", 4, 0, false, 0, 65521, 0, 0, "", ""},
{"<command line>", 4, 0, VersionScopeNone, -1, 65521, 0, 0, "", ""}, {"<command line>", 4, 0, false, 0, 65521, 0, 0, "", ""},
{"<built-in>", 4, 0, VersionScopeNone, -1, 65521, 0, 0, "", ""}, {"<built-in>", 4, 0, false, 0, 65521, 0, 0, "", ""},
{"/usr/src/lib/csu/i386-elf/crtn.S", 4, 0, VersionScopeNone, -1, 65521, 0, 0, "", ""}, {"/usr/src/lib/csu/i386-elf/crtn.S", 4, 0, false, 0, 65521, 0, 0, "", ""},
{"hello.c", 4, 0, VersionScopeNone, -1, 65521, 0, 0, "", ""}, {"hello.c", 4, 0, false, 0, 65521, 0, 0, "", ""},
{"printf", 18, 0, VersionScopeNone, -1, 0, 0, 44, "", ""}, {"printf", 18, 0, false, 0, 0, 0, 44, "", ""},
{"_DYNAMIC", 17, 0, VersionScopeNone, -1, 65521, 134518284, 0, "", ""}, {"_DYNAMIC", 17, 0, false, 0, 65521, 134518284, 0, "", ""},
{"__dso_handle", 17, 2, VersionScopeNone, -1, 11, 134518272, 0, "", ""}, {"__dso_handle", 17, 2, false, 0, 11, 134518272, 0, "", ""},
{"_init", 18, 0, VersionScopeNone, -1, 6, 134513512, 0, "", ""}, {"_init", 18, 0, false, 0, 6, 134513512, 0, "", ""},
{"environ", 17, 0, VersionScopeNone, -1, 18, 134518512, 4, "", ""}, {"environ", 17, 0, false, 0, 18, 134518512, 4, "", ""},
{"__deregister_frame_info", 32, 0, VersionScopeNone, -1, 0, 0, 0, "", ""}, {"__deregister_frame_info", 32, 0, false, 0, 0, 0, 0, "", ""},
{"__progname", 17, 0, VersionScopeNone, -1, 11, 134518268, 4, "", ""}, {"__progname", 17, 0, false, 0, 11, 134518268, 4, "", ""},
{"_start", 18, 0, VersionScopeNone, -1, 8, 134513612, 145, "", ""}, {"_start", 18, 0, false, 0, 8, 134513612, 145, "", ""},
{"__bss_start", 16, 0, VersionScopeNone, -1, 65521, 134518484, 0, "", ""}, {"__bss_start", 16, 0, false, 0, 65521, 134518484, 0, "", ""},
{"main", 18, 0, VersionScopeNone, -1, 8, 134513912, 46, "", ""}, {"main", 18, 0, false, 0, 8, 134513912, 46, "", ""},
{"_init_tls", 18, 0, VersionScopeNone, -1, 0, 0, 5, "", ""}, {"_init_tls", 18, 0, false, 0, 0, 0, 5, "", ""},
{"_fini", 18, 0, VersionScopeNone, -1, 9, 134513996, 0, "", ""}, {"_fini", 18, 0, false, 0, 9, 134513996, 0, "", ""},
{"atexit", 18, 0, VersionScopeNone, -1, 0, 0, 43, "", ""}, {"atexit", 18, 0, false, 0, 0, 0, 43, "", ""},
{"_edata", 16, 0, VersionScopeNone, -1, 65521, 134518484, 0, "", ""}, {"_edata", 16, 0, false, 0, 65521, 134518484, 0, "", ""},
{"_GLOBAL_OFFSET_TABLE_", 17, 0, VersionScopeNone, -1, 65521, 134518456, 0, "", ""}, {"_GLOBAL_OFFSET_TABLE_", 17, 0, false, 0, 65521, 134518456, 0, "", ""},
{"_end", 16, 0, VersionScopeNone, -1, 65521, 134518516, 0, "", ""}, {"_end", 16, 0, false, 0, 65521, 134518516, 0, "", ""},
{"exit", 18, 0, VersionScopeNone, -1, 0, 0, 68, "", ""}, {"exit", 18, 0, false, 0, 0, 0, 68, "", ""},
{"_Jv_RegisterClasses", 32, 0, VersionScopeNone, -1, 0, 0, 0, "", ""}, {"_Jv_RegisterClasses", 32, 0, false, 0, 0, 0, 0, "", ""},
{"__register_frame_info", 32, 0, VersionScopeNone, -1, 0, 0, 0, "", ""}, {"__register_frame_info", 32, 0, false, 0, 0, 0, 0, "", ""},
}, },
}, },
{ {
@ -208,79 +208,79 @@ var fileTests = []fileTest{
}, },
[]string{"libc.so.6"}, []string{"libc.so.6"},
[]Symbol{ []Symbol{
{"", 3, 0, VersionScopeNone, -1, 1, 4194816, 0, "", ""}, {"", 3, 0, false, 0, 1, 4194816, 0, "", ""},
{"", 3, 0, VersionScopeNone, -1, 2, 4194844, 0, "", ""}, {"", 3, 0, false, 0, 2, 4194844, 0, "", ""},
{"", 3, 0, VersionScopeNone, -1, 3, 4194880, 0, "", ""}, {"", 3, 0, false, 0, 3, 4194880, 0, "", ""},
{"", 3, 0, VersionScopeNone, -1, 4, 4194920, 0, "", ""}, {"", 3, 0, false, 0, 4, 4194920, 0, "", ""},
{"", 3, 0, VersionScopeNone, -1, 5, 4194952, 0, "", ""}, {"", 3, 0, false, 0, 5, 4194952, 0, "", ""},
{"", 3, 0, VersionScopeNone, -1, 6, 4195048, 0, "", ""}, {"", 3, 0, false, 0, 6, 4195048, 0, "", ""},
{"", 3, 0, VersionScopeNone, -1, 7, 4195110, 0, "", ""}, {"", 3, 0, false, 0, 7, 4195110, 0, "", ""},
{"", 3, 0, VersionScopeNone, -1, 8, 4195120, 0, "", ""}, {"", 3, 0, false, 0, 8, 4195120, 0, "", ""},
{"", 3, 0, VersionScopeNone, -1, 9, 4195152, 0, "", ""}, {"", 3, 0, false, 0, 9, 4195152, 0, "", ""},
{"", 3, 0, VersionScopeNone, -1, 10, 4195176, 0, "", ""}, {"", 3, 0, false, 0, 10, 4195176, 0, "", ""},
{"", 3, 0, VersionScopeNone, -1, 11, 4195224, 0, "", ""}, {"", 3, 0, false, 0, 11, 4195224, 0, "", ""},
{"", 3, 0, VersionScopeNone, -1, 12, 4195248, 0, "", ""}, {"", 3, 0, false, 0, 12, 4195248, 0, "", ""},
{"", 3, 0, VersionScopeNone, -1, 13, 4195296, 0, "", ""}, {"", 3, 0, false, 0, 13, 4195296, 0, "", ""},
{"", 3, 0, VersionScopeNone, -1, 14, 4195732, 0, "", ""}, {"", 3, 0, false, 0, 14, 4195732, 0, "", ""},
{"", 3, 0, VersionScopeNone, -1, 15, 4195748, 0, "", ""}, {"", 3, 0, false, 0, 15, 4195748, 0, "", ""},
{"", 3, 0, VersionScopeNone, -1, 16, 4195768, 0, "", ""}, {"", 3, 0, false, 0, 16, 4195768, 0, "", ""},
{"", 3, 0, VersionScopeNone, -1, 17, 4195808, 0, "", ""}, {"", 3, 0, false, 0, 17, 4195808, 0, "", ""},
{"", 3, 0, VersionScopeNone, -1, 18, 6293128, 0, "", ""}, {"", 3, 0, false, 0, 18, 6293128, 0, "", ""},
{"", 3, 0, VersionScopeNone, -1, 19, 6293144, 0, "", ""}, {"", 3, 0, false, 0, 19, 6293144, 0, "", ""},
{"", 3, 0, VersionScopeNone, -1, 20, 6293160, 0, "", ""}, {"", 3, 0, false, 0, 20, 6293160, 0, "", ""},
{"", 3, 0, VersionScopeNone, -1, 21, 6293168, 0, "", ""}, {"", 3, 0, false, 0, 21, 6293168, 0, "", ""},
{"", 3, 0, VersionScopeNone, -1, 22, 6293584, 0, "", ""}, {"", 3, 0, false, 0, 22, 6293584, 0, "", ""},
{"", 3, 0, VersionScopeNone, -1, 23, 6293592, 0, "", ""}, {"", 3, 0, false, 0, 23, 6293592, 0, "", ""},
{"", 3, 0, VersionScopeNone, -1, 24, 6293632, 0, "", ""}, {"", 3, 0, false, 0, 24, 6293632, 0, "", ""},
{"", 3, 0, VersionScopeNone, -1, 25, 6293656, 0, "", ""}, {"", 3, 0, false, 0, 25, 6293656, 0, "", ""},
{"", 3, 0, VersionScopeNone, -1, 26, 0, 0, "", ""}, {"", 3, 0, false, 0, 26, 0, 0, "", ""},
{"", 3, 0, VersionScopeNone, -1, 27, 0, 0, "", ""}, {"", 3, 0, false, 0, 27, 0, 0, "", ""},
{"", 3, 0, VersionScopeNone, -1, 28, 0, 0, "", ""}, {"", 3, 0, false, 0, 28, 0, 0, "", ""},
{"", 3, 0, VersionScopeNone, -1, 29, 0, 0, "", ""}, {"", 3, 0, false, 0, 29, 0, 0, "", ""},
{"", 3, 0, VersionScopeNone, -1, 30, 0, 0, "", ""}, {"", 3, 0, false, 0, 30, 0, 0, "", ""},
{"", 3, 0, VersionScopeNone, -1, 31, 0, 0, "", ""}, {"", 3, 0, false, 0, 31, 0, 0, "", ""},
{"", 3, 0, VersionScopeNone, -1, 32, 0, 0, "", ""}, {"", 3, 0, false, 0, 32, 0, 0, "", ""},
{"", 3, 0, VersionScopeNone, -1, 33, 0, 0, "", ""}, {"", 3, 0, false, 0, 33, 0, 0, "", ""},
{"init.c", 4, 0, VersionScopeNone, -1, 65521, 0, 0, "", ""}, {"init.c", 4, 0, false, 0, 65521, 0, 0, "", ""},
{"initfini.c", 4, 0, VersionScopeNone, -1, 65521, 0, 0, "", ""}, {"initfini.c", 4, 0, false, 0, 65521, 0, 0, "", ""},
{"call_gmon_start", 2, 0, VersionScopeNone, -1, 13, 4195340, 0, "", ""}, {"call_gmon_start", 2, 0, false, 0, 13, 4195340, 0, "", ""},
{"crtstuff.c", 4, 0, VersionScopeNone, -1, 65521, 0, 0, "", ""}, {"crtstuff.c", 4, 0, false, 0, 65521, 0, 0, "", ""},
{"__CTOR_LIST__", 1, 0, VersionScopeNone, -1, 18, 6293128, 0, "", ""}, {"__CTOR_LIST__", 1, 0, false, 0, 18, 6293128, 0, "", ""},
{"__DTOR_LIST__", 1, 0, VersionScopeNone, -1, 19, 6293144, 0, "", ""}, {"__DTOR_LIST__", 1, 0, false, 0, 19, 6293144, 0, "", ""},
{"__JCR_LIST__", 1, 0, VersionScopeNone, -1, 20, 6293160, 0, "", ""}, {"__JCR_LIST__", 1, 0, false, 0, 20, 6293160, 0, "", ""},
{"__do_global_dtors_aux", 2, 0, VersionScopeNone, -1, 13, 4195376, 0, "", ""}, {"__do_global_dtors_aux", 2, 0, false, 0, 13, 4195376, 0, "", ""},
{"completed.6183", 1, 0, VersionScopeNone, -1, 25, 6293656, 1, "", ""}, {"completed.6183", 1, 0, false, 0, 25, 6293656, 1, "", ""},
{"p.6181", 1, 0, VersionScopeNone, -1, 24, 6293648, 0, "", ""}, {"p.6181", 1, 0, false, 0, 24, 6293648, 0, "", ""},
{"frame_dummy", 2, 0, VersionScopeNone, -1, 13, 4195440, 0, "", ""}, {"frame_dummy", 2, 0, false, 0, 13, 4195440, 0, "", ""},
{"crtstuff.c", 4, 0, VersionScopeNone, -1, 65521, 0, 0, "", ""}, {"crtstuff.c", 4, 0, false, 0, 65521, 0, 0, "", ""},
{"__CTOR_END__", 1, 0, VersionScopeNone, -1, 18, 6293136, 0, "", ""}, {"__CTOR_END__", 1, 0, false, 0, 18, 6293136, 0, "", ""},
{"__DTOR_END__", 1, 0, VersionScopeNone, -1, 19, 6293152, 0, "", ""}, {"__DTOR_END__", 1, 0, false, 0, 19, 6293152, 0, "", ""},
{"__FRAME_END__", 1, 0, VersionScopeNone, -1, 17, 4195968, 0, "", ""}, {"__FRAME_END__", 1, 0, false, 0, 17, 4195968, 0, "", ""},
{"__JCR_END__", 1, 0, VersionScopeNone, -1, 20, 6293160, 0, "", ""}, {"__JCR_END__", 1, 0, false, 0, 20, 6293160, 0, "", ""},
{"__do_global_ctors_aux", 2, 0, VersionScopeNone, -1, 13, 4195680, 0, "", ""}, {"__do_global_ctors_aux", 2, 0, false, 0, 13, 4195680, 0, "", ""},
{"initfini.c", 4, 0, VersionScopeNone, -1, 65521, 0, 0, "", ""}, {"initfini.c", 4, 0, false, 0, 65521, 0, 0, "", ""},
{"hello.c", 4, 0, VersionScopeNone, -1, 65521, 0, 0, "", ""}, {"hello.c", 4, 0, false, 0, 65521, 0, 0, "", ""},
{"_GLOBAL_OFFSET_TABLE_", 1, 2, VersionScopeNone, -1, 23, 6293592, 0, "", ""}, {"_GLOBAL_OFFSET_TABLE_", 1, 2, false, 0, 23, 6293592, 0, "", ""},
{"__init_array_end", 0, 2, VersionScopeNone, -1, 18, 6293124, 0, "", ""}, {"__init_array_end", 0, 2, false, 0, 18, 6293124, 0, "", ""},
{"__init_array_start", 0, 2, VersionScopeNone, -1, 18, 6293124, 0, "", ""}, {"__init_array_start", 0, 2, false, 0, 18, 6293124, 0, "", ""},
{"_DYNAMIC", 1, 2, VersionScopeNone, -1, 21, 6293168, 0, "", ""}, {"_DYNAMIC", 1, 2, false, 0, 21, 6293168, 0, "", ""},
{"data_start", 32, 0, VersionScopeNone, -1, 24, 6293632, 0, "", ""}, {"data_start", 32, 0, false, 0, 24, 6293632, 0, "", ""},
{"__libc_csu_fini", 18, 0, VersionScopeNone, -1, 13, 4195520, 2, "", ""}, {"__libc_csu_fini", 18, 0, false, 0, 13, 4195520, 2, "", ""},
{"_start", 18, 0, VersionScopeNone, -1, 13, 4195296, 0, "", ""}, {"_start", 18, 0, false, 0, 13, 4195296, 0, "", ""},
{"__gmon_start__", 32, 0, VersionScopeNone, -1, 0, 0, 0, "", ""}, {"__gmon_start__", 32, 0, false, 0, 0, 0, 0, "", ""},
{"_Jv_RegisterClasses", 32, 0, VersionScopeNone, -1, 0, 0, 0, "", ""}, {"_Jv_RegisterClasses", 32, 0, false, 0, 0, 0, 0, "", ""},
{"puts@@GLIBC_2.2.5", 18, 0, VersionScopeNone, -1, 0, 0, 396, "", ""}, {"puts@@GLIBC_2.2.5", 18, 0, false, 0, 0, 0, 396, "", ""},
{"_fini", 18, 0, VersionScopeNone, -1, 14, 4195732, 0, "", ""}, {"_fini", 18, 0, false, 0, 14, 4195732, 0, "", ""},
{"__libc_start_main@@GLIBC_2.2.5", 18, 0, VersionScopeNone, -1, 0, 0, 450, "", ""}, {"__libc_start_main@@GLIBC_2.2.5", 18, 0, false, 0, 0, 0, 450, "", ""},
{"_IO_stdin_used", 17, 0, VersionScopeNone, -1, 15, 4195748, 4, "", ""}, {"_IO_stdin_used", 17, 0, false, 0, 15, 4195748, 4, "", ""},
{"__data_start", 16, 0, VersionScopeNone, -1, 24, 6293632, 0, "", ""}, {"__data_start", 16, 0, false, 0, 24, 6293632, 0, "", ""},
{"__dso_handle", 17, 2, VersionScopeNone, -1, 24, 6293640, 0, "", ""}, {"__dso_handle", 17, 2, false, 0, 24, 6293640, 0, "", ""},
{"__libc_csu_init", 18, 0, VersionScopeNone, -1, 13, 4195536, 137, "", ""}, {"__libc_csu_init", 18, 0, false, 0, 13, 4195536, 137, "", ""},
{"__bss_start", 16, 0, VersionScopeNone, -1, 65521, 6293656, 0, "", ""}, {"__bss_start", 16, 0, false, 0, 65521, 6293656, 0, "", ""},
{"_end", 16, 0, VersionScopeNone, -1, 65521, 6293664, 0, "", ""}, {"_end", 16, 0, false, 0, 65521, 6293664, 0, "", ""},
{"_edata", 16, 0, VersionScopeNone, -1, 65521, 6293656, 0, "", ""}, {"_edata", 16, 0, false, 0, 65521, 6293656, 0, "", ""},
{"main", 18, 0, VersionScopeNone, -1, 13, 4195480, 27, "", ""}, {"main", 18, 0, false, 0, 13, 4195480, 27, "", ""},
{"_init", 18, 0, VersionScopeNone, -1, 11, 4195224, 0, "", ""}, {"_init", 18, 0, false, 0, 11, 4195224, 0, "", ""},
}, },
}, },
{ {
@ -338,21 +338,21 @@ var fileTests = []fileTest{
[]ProgHeader{}, []ProgHeader{},
nil, nil,
[]Symbol{ []Symbol{
{"hello.c", 4, 0, VersionScopeNone, -1, 65521, 0, 0, "", ""}, {"hello.c", 4, 0, false, 0, 65521, 0, 0, "", ""},
{"", 3, 0, VersionScopeNone, -1, 1, 0, 0, "", ""}, {"", 3, 0, false, 0, 1, 0, 0, "", ""},
{"", 3, 0, VersionScopeNone, -1, 3, 0, 0, "", ""}, {"", 3, 0, false, 0, 3, 0, 0, "", ""},
{"", 3, 0, VersionScopeNone, -1, 4, 0, 0, "", ""}, {"", 3, 0, false, 0, 4, 0, 0, "", ""},
{"", 3, 0, VersionScopeNone, -1, 5, 0, 0, "", ""}, {"", 3, 0, false, 0, 5, 0, 0, "", ""},
{"", 3, 0, VersionScopeNone, -1, 6, 0, 0, "", ""}, {"", 3, 0, false, 0, 6, 0, 0, "", ""},
{"", 3, 0, VersionScopeNone, -1, 8, 0, 0, "", ""}, {"", 3, 0, false, 0, 8, 0, 0, "", ""},
{"", 3, 0, VersionScopeNone, -1, 9, 0, 0, "", ""}, {"", 3, 0, false, 0, 9, 0, 0, "", ""},
{"", 3, 0, VersionScopeNone, -1, 11, 0, 0, "", ""}, {"", 3, 0, false, 0, 11, 0, 0, "", ""},
{"", 3, 0, VersionScopeNone, -1, 13, 0, 0, "", ""}, {"", 3, 0, false, 0, 13, 0, 0, "", ""},
{"", 3, 0, VersionScopeNone, -1, 15, 0, 0, "", ""}, {"", 3, 0, false, 0, 15, 0, 0, "", ""},
{"", 3, 0, VersionScopeNone, -1, 16, 0, 0, "", ""}, {"", 3, 0, false, 0, 16, 0, 0, "", ""},
{"", 3, 0, VersionScopeNone, -1, 14, 0, 0, "", ""}, {"", 3, 0, false, 0, 14, 0, 0, "", ""},
{"main", 18, 0, VersionScopeNone, -1, 1, 0, 23, "", ""}, {"main", 18, 0, false, 0, 1, 0, 23, "", ""},
{"puts", 16, 0, VersionScopeNone, -1, 0, 0, 0, "", ""}, {"puts", 16, 0, false, 0, 0, 0, 0, "", ""},
}, },
}, },
{ {
@ -384,21 +384,21 @@ var fileTests = []fileTest{
[]ProgHeader{}, []ProgHeader{},
nil, nil,
[]Symbol{ []Symbol{
{"hello.c", 4, 0, VersionScopeNone, -1, 65521, 0, 0, "", ""}, {"hello.c", 4, 0, false, 0, 65521, 0, 0, "", ""},
{"", 3, 0, VersionScopeNone, -1, 1, 0, 0, "", ""}, {"", 3, 0, false, 0, 1, 0, 0, "", ""},
{"", 3, 0, VersionScopeNone, -1, 3, 0, 0, "", ""}, {"", 3, 0, false, 0, 3, 0, 0, "", ""},
{"", 3, 0, VersionScopeNone, -1, 4, 0, 0, "", ""}, {"", 3, 0, false, 0, 4, 0, 0, "", ""},
{"", 3, 0, VersionScopeNone, -1, 5, 0, 0, "", ""}, {"", 3, 0, false, 0, 5, 0, 0, "", ""},
{"", 3, 0, VersionScopeNone, -1, 6, 0, 0, "", ""}, {"", 3, 0, false, 0, 6, 0, 0, "", ""},
{"", 3, 0, VersionScopeNone, -1, 8, 0, 0, "", ""}, {"", 3, 0, false, 0, 8, 0, 0, "", ""},
{"", 3, 0, VersionScopeNone, -1, 9, 0, 0, "", ""}, {"", 3, 0, false, 0, 9, 0, 0, "", ""},
{"", 3, 0, VersionScopeNone, -1, 11, 0, 0, "", ""}, {"", 3, 0, false, 0, 11, 0, 0, "", ""},
{"", 3, 0, VersionScopeNone, -1, 13, 0, 0, "", ""}, {"", 3, 0, false, 0, 13, 0, 0, "", ""},
{"", 3, 0, VersionScopeNone, -1, 15, 0, 0, "", ""}, {"", 3, 0, false, 0, 15, 0, 0, "", ""},
{"", 3, 0, VersionScopeNone, -1, 16, 0, 0, "", ""}, {"", 3, 0, false, 0, 16, 0, 0, "", ""},
{"", 3, 0, VersionScopeNone, -1, 14, 0, 0, "", ""}, {"", 3, 0, false, 0, 14, 0, 0, "", ""},
{"main", 18, 0, VersionScopeNone, -1, 1, 0, 27, "", ""}, {"main", 18, 0, false, 0, 1, 0, 27, "", ""},
{"puts", 16, 0, VersionScopeNone, -1, 0, 0, 0, "", ""}, {"puts", 16, 0, false, 0, 0, 0, 0, "", ""},
}, },
}, },
{ {
@ -430,21 +430,21 @@ var fileTests = []fileTest{
[]ProgHeader{}, []ProgHeader{},
nil, nil,
[]Symbol{ []Symbol{
{"hello.c", 4, 0, VersionScopeNone, -1, 65521, 0, 0, "", ""}, {"hello.c", 4, 0, false, 0, 65521, 0, 0, "", ""},
{"", 3, 0, VersionScopeNone, -1, 1, 0, 0, "", ""}, {"", 3, 0, false, 0, 1, 0, 0, "", ""},
{"", 3, 0, VersionScopeNone, -1, 3, 0, 0, "", ""}, {"", 3, 0, false, 0, 3, 0, 0, "", ""},
{"", 3, 0, VersionScopeNone, -1, 4, 0, 0, "", ""}, {"", 3, 0, false, 0, 4, 0, 0, "", ""},
{"", 3, 0, VersionScopeNone, -1, 5, 0, 0, "", ""}, {"", 3, 0, false, 0, 5, 0, 0, "", ""},
{"", 3, 0, VersionScopeNone, -1, 6, 0, 0, "", ""}, {"", 3, 0, false, 0, 6, 0, 0, "", ""},
{"", 3, 0, VersionScopeNone, -1, 8, 0, 0, "", ""}, {"", 3, 0, false, 0, 8, 0, 0, "", ""},
{"", 3, 0, VersionScopeNone, -1, 9, 0, 0, "", ""}, {"", 3, 0, false, 0, 9, 0, 0, "", ""},
{"", 3, 0, VersionScopeNone, -1, 11, 0, 0, "", ""}, {"", 3, 0, false, 0, 11, 0, 0, "", ""},
{"", 3, 0, VersionScopeNone, -1, 13, 0, 0, "", ""}, {"", 3, 0, false, 0, 13, 0, 0, "", ""},
{"", 3, 0, VersionScopeNone, -1, 15, 0, 0, "", ""}, {"", 3, 0, false, 0, 15, 0, 0, "", ""},
{"", 3, 0, VersionScopeNone, -1, 16, 0, 0, "", ""}, {"", 3, 0, false, 0, 16, 0, 0, "", ""},
{"", 3, 0, VersionScopeNone, -1, 14, 0, 0, "", ""}, {"", 3, 0, false, 0, 14, 0, 0, "", ""},
{"main", 18, 0, VersionScopeNone, -1, 1, 0, 44, "", ""}, {"main", 18, 0, false, 0, 1, 0, 44, "", ""},
{"puts", 16, 0, VersionScopeNone, -1, 0, 0, 0, "", ""}, {"puts", 16, 0, false, 0, 0, 0, 0, "", ""},
}, },
}, },
} }

File diff suppressed because it is too large Load Diff