• 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
..
amd64 Loading commit data...
arm Loading commit data...
arm64 Loading commit data...
ld Loading commit data...
loadelf Loading commit data...
loadmacho Loading commit data...
loadpe Loading commit data...
mips Loading commit data...
mips64 Loading commit data...
objfile Loading commit data...
ppc64 Loading commit data...
s390x Loading commit data...
sym Loading commit data...
wasm Loading commit data...
x86 Loading commit data...