v = uint32(rs.Dynid)
v |= 1 << 27 // external relocation
} else {
- v = uint32((rs.Sect.(*ld.Section)).Extnum)
+ v = uint32(rs.Sect.Extnum)
if v == 0 {
- ld.Diag("reloc %d to symbol %s in non-macho section %s type=%d", r.Type, rs.Name, (rs.Sect.(*ld.Section)).Name, rs.Type)
+ ld.Diag("reloc %d to symbol %s in non-macho section %s type=%d", r.Type, rs.Name, rs.Sect.Name, rs.Type)
return -1
}
}
v = uint32(rs.Dynid)
v |= 1 << 27 // external relocation
} else {
- v = uint32((rs.Sect.(*ld.Section)).Extnum)
+ v = uint32(rs.Sect.Extnum)
if v == 0 {
- ld.Diag("reloc %d to symbol %s in non-macho section %s type=%d", r.Type, rs.Name, (rs.Sect.(*ld.Section)).Name, rs.Type)
+ ld.Diag("reloc %d to symbol %s in non-macho section %s type=%d", r.Type, rs.Name, rs.Sect.Name, rs.Type)
return -1
}
}
v = uint32(rs.Dynid)
v |= 1 << 27 // external relocation
} else {
- v = uint32((rs.Sect.(*ld.Section)).Extnum)
+ v = uint32(rs.Sect.Extnum)
if v == 0 {
- ld.Diag("reloc %d to symbol %s in non-macho section %s type=%d", r.Type, rs.Name, (rs.Sect.(*ld.Section)).Name, rs.Type)
+ ld.Diag("reloc %d to symbol %s in non-macho section %s type=%d", r.Type, rs.Name, rs.Sect.Name, rs.Type)
return -1
}
}
} else if HEADTYPE == obj.Hdarwin {
if r.Type == obj.R_CALL {
if rs.Type != obj.SHOSTOBJ {
- o += int64(uint64(Symaddr(rs)) - (rs.Sect.(*Section)).Vaddr)
+ o += int64(uint64(Symaddr(rs)) - rs.Sect.Vaddr)
}
o -= int64(r.Off) // relative to section offset, not symbol
} else {
o += int64(r.Siz)
// GNU ld always add VirtualAddress of the .text section to the
// relocated address, compensate that.
- o -= int64(s.Sect.(*Section).Vaddr - PEBASE)
+ o -= int64(s.Sect.Vaddr - PEBASE)
} else {
Diag("unhandled pcrel relocation for %s", headstring)
}
for sym := datap; sym != nil; sym = sym.Next {
Ctxt.Cursym = sym
if sym.Sect != nil {
- sym.Value += int64((sym.Sect.(*Section)).Vaddr)
+ sym.Value += int64(sym.Sect.Vaddr)
}
for sub = sym.Sub; sub != nil; sub = sub.Sub {
sub.Value += sym.Value
sh.entsize += uint64(Thearch.Regsize)
}
sh.link = uint32(elfshname(".symtab").shnum)
- sh.info = uint32((sect.Elfsect.(*ElfShdr)).shnum)
+ sh.info = uint32(sect.Elfsect.shnum)
sh.off = sect.Reloff
sh.size = sect.Rellen
sh.addralign = uint64(Thearch.Regsize)
Length uint64
Next *Section
Seg *Segment
- Elfsect interface{}
+ Elfsect *ElfShdr
Reloff uint64
Rellen uint64
}
File string
Dynimplib string
Dynimpvers string
- Sect interface{}
+ Sect *Section
Autom *Auto
Pcln *Pcln
P []byte
Diag("missing section for %s", s.Name)
Adduint8(Ctxt, symtab, 0)
} else {
- Adduint8(Ctxt, symtab, uint8((o.Sect.(*Section)).Extnum))
+ Adduint8(Ctxt, symtab, uint8(o.Sect.Extnum))
}
Adduint16(Ctxt, symtab, 0) // desc
adduintxx(Ctxt, symtab, uint64(Symaddr(s)), Thearch.Ptrsize)
Diag("missing section in putelfsym")
return
}
- if xo.Sect.(*Section).Elfsect == nil {
+ if xo.Sect.Elfsect == nil {
Ctxt.Cursym = x
Diag("missing ELF section in putelfsym")
return
}
- elfshnum = xo.Sect.(*Section).Elfsect.(*ElfShdr).shnum
+ elfshnum = xo.Sect.Elfsect.shnum
}
// One pass for each binding: STB_LOCAL, STB_GLOBAL,
off := putelfstr(s)
if Linkmode == LinkExternal && elfshnum != SHN_UNDEF {
- addr -= int64(xo.Sect.(*Section).Vaddr)
+ addr -= int64(xo.Sect.Vaddr)
}
other := STV_DEFAULT
if x.Type&obj.SHIDDEN != 0 {
v = uint32(rs.Dynid)
v |= 1 << 27 // external relocation
} else {
- v = uint32((rs.Sect.(*ld.Section)).Extnum)
+ v = uint32(rs.Sect.Extnum)
if v == 0 {
- ld.Diag("reloc %d to symbol %s in non-macho section %s type=%d", r.Type, rs.Name, (rs.Sect.(*ld.Section)).Name, rs.Type)
+ ld.Diag("reloc %d to symbol %s in non-macho section %s type=%d", r.Type, rs.Name, rs.Sect.Name, rs.Type)
return -1
}
}