• Alex Brainman's avatar
    cmd/link: move .rel symbol from .rdata into .text · 8256bcda
    Alex Brainman authored
    .rel symbol type is sym.SELFROSECT, and that makes .rel written
    into .rdata section. But .rel stores code - jump table used for
    external C functions. So we have to mark whole .rdata section
    as executable (IMAGE_SCN_MEM_EXECUTE), because of .rel presence
    in it.
    
    Move .rel into .text section, and make .rdata section non executable.
    
    I also had to move code that adjusted the size of .rel symbol
    before calling textaddress, otherwise textaddress would not
    calculate size of .text section correctly.
    
    Fixes #25926
    
    Change-Id: I4962f5de7b367410154c8709adfcd8472de9ac1a
    Reviewed-on: https://go-review.googlesource.com/c/125455
    Run-TryBot: Alex Brainman <alex.brainman@gmail.com>
    TryBot-Result: Gobot Gobot <gobot@golang.org>
    Reviewed-by: 's avatarIan Lance Taylor <iant@golang.org>
    8256bcda
Name
Last commit
Last update
..
testdata Loading commit data...
ar.go Loading commit data...
config.go Loading commit data...
data.go Loading commit data...
deadcode.go Loading commit data...
decodesym.go Loading commit data...
dwarf.go Loading commit data...
dwarf_test.go Loading commit data...
elf.go Loading commit data...
go.go Loading commit data...
ld.go Loading commit data...
ld_test.go Loading commit data...
lib.go Loading commit data...
link.go Loading commit data...
macho.go Loading commit data...
macho_combine_dwarf.go Loading commit data...
main.go Loading commit data...
nooptcgolink_test.go Loading commit data...
outbuf.go Loading commit data...
pcln.go Loading commit data...
pe.go Loading commit data...
sym.go Loading commit data...
symtab.go Loading commit data...
typelink.go Loading commit data...
util.go Loading commit data...