• 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
.github Loading commit data...
api Loading commit data...
doc Loading commit data...
lib/time Loading commit data...
misc Loading commit data...
src Loading commit data...
test Loading commit data...
.gitattributes Loading commit data...
.gitignore Loading commit data...
AUTHORS Loading commit data...
CONTRIBUTING.md Loading commit data...
CONTRIBUTORS Loading commit data...
LICENSE Loading commit data...
PATENTS Loading commit data...
README.md Loading commit data...
favicon.ico Loading commit data...
robots.txt Loading commit data...