]> Cypherpunks repositories - gostls13.git/commit
cmd/link: move .rel symbol from .rdata into .text
authorAlex Brainman <alex.brainman@gmail.com>
Sat, 16 Jun 2018 06:23:52 +0000 (16:23 +1000)
committerAlex Brainman <alex.brainman@gmail.com>
Fri, 5 Oct 2018 08:54:24 +0000 (08:54 +0000)
commit8256bcdae0da68644db1e33c0db86f5ac4395c4b
tree537013ac2182b04015cb1d258f46eea2126ab48f
parent48e22da1d24dc5b038bd83a78553173af5474e76
cmd/link: move .rel symbol from .rdata into .text

.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: Ian Lance Taylor <iant@golang.org>
src/cmd/link/internal/ld/data.go
src/cmd/link/internal/ld/main.go
src/cmd/link/internal/ld/pe.go