sbf: rename loader.go -> parse.go

This commit is contained in:
Richard Patel 2022-09-02 04:01:44 +02:00
parent 2bc5c4ec59
commit 9e81eea4ff
2 changed files with 13 additions and 0 deletions

View File

@ -62,6 +62,16 @@ func TestLoadProgram_Noop(t *testing.T) {
Addralign: 1,
}, loader.shShstrtab)
assert.Equal(t, &elf.Section64{
Name: 50,
Type: uint32(elf.SHT_PROGBITS),
Flags: 6,
Addr: 4096,
Off: 4096,
Size: 96,
Addralign: 8,
}, loader.shText)
assert.Equal(t, &elf.Section64{
Name: 74,
Type: uint32(elf.SHT_SYMTAB),

View File

@ -41,6 +41,7 @@ type loader struct {
phLoad elf.Prog64
phDynamic *elf.Prog64
shShstrtab elf.Section64
shText *elf.Section64
shSymtab *elf.Section64
shStrtab *elf.Section64
shDynstr *elf.Section64
@ -295,6 +296,8 @@ func (l *loader) parseSections() error {
return nil
}
switch sectionName {
case ".text":
err = setSection(&l.shText)
case ".symtab":
err = setSection(&l.shSymtab)
case ".strtab":