cmd/internal/ld, cmd/7l: external linking support for linux/arm64

Based on Michael Hudson-Doyle's patch:
b735215ee4

Change-Id: I309e3df7608b9eef9339196fdc50dedf5f9439f0
Reviewed-on: https://go-review.googlesource.com/8437
Reviewed-by: Aram Hăvărneanu <aram@mgk.ro>
Reviewed-by: David Crawshaw <crawshaw@golang.org>
This commit is contained in:
Shenghou Ma 2015-04-03 04:37:11 -04:00 committed by Minux Ma
parent a50b24c649
commit f55b2a11f4
6 changed files with 68 additions and 23 deletions

View file

@ -2367,12 +2367,13 @@ func dwarfaddshstrings(shstrtab *LSym) {
elfstrdbg[ElfStrDebugStr] = Addstring(shstrtab, ".debug_str")
elfstrdbg[ElfStrGDBScripts] = Addstring(shstrtab, ".debug_gdb_scripts")
if Linkmode == LinkExternal {
if Thearch.Thechar == '6' || Thearch.Thechar == '9' {
switch Thearch.Thechar {
case '6', '7', '9':
elfstrdbg[ElfStrRelDebugInfo] = Addstring(shstrtab, ".rela.debug_info")
elfstrdbg[ElfStrRelDebugAranges] = Addstring(shstrtab, ".rela.debug_aranges")
elfstrdbg[ElfStrRelDebugLine] = Addstring(shstrtab, ".rela.debug_line")
elfstrdbg[ElfStrRelDebugFrame] = Addstring(shstrtab, ".rela.debug_frame")
} else {
default:
elfstrdbg[ElfStrRelDebugInfo] = Addstring(shstrtab, ".rel.debug_info")
elfstrdbg[ElfStrRelDebugAranges] = Addstring(shstrtab, ".rel.debug_aranges")
elfstrdbg[ElfStrRelDebugLine] = Addstring(shstrtab, ".rel.debug_line")
@ -2419,9 +2420,10 @@ func dwarfaddelfsectionsyms() {
func dwarfaddelfrelocheader(elfstr int, shdata *ElfShdr, off int64, size int64) {
sh := newElfShdr(elfstrdbg[elfstr])
if Thearch.Thechar == '6' || Thearch.Thechar == '9' {
switch Thearch.Thechar {
case '6', '7', '9':
sh.type_ = SHT_RELA
} else {
default:
sh.type_ = SHT_REL
}