]> Cypherpunks repositories - gostls13.git/commit
[dev.link] cmd/link: reduce alignment requirement for symtab/elfstr
authorThan McIntosh <thanm@google.com>
Mon, 15 Jun 2020 19:16:51 +0000 (15:16 -0400)
committerThan McIntosh <thanm@google.com>
Wed, 17 Jun 2020 11:15:12 +0000 (11:15 +0000)
commit188e995ae9de004322d3f822f70dc9d814e2c03b
tree7226319ae6b197185fa9301e831f5dc75742ac69
parentef9e8fbfbc904b2c49cdf4fc7524aaf0f059f2da
[dev.link] cmd/link: reduce alignment requirement for symtab/elfstr

The linker's asmb phase for ELF has a chunk of code that decides where
to place the .symtab and .strtab sections, which appear after after
the DWARF data; this code currently tries to align the start of the
.symtab section using the value of -R (stored in *FlagRound). This
patch gets rid of this additional alignment and instead just aligns
.symtab by pointer size. The -R value is needed for loadable
segments/sections (such as text or data), not for non-loadable
sections (e.g. symtab). On most architectures the *FlagRound value is
4k, however on ARM64 it is 64k, meaning that aligning symtab on this
boundary can waste a good chunk of space.

Change-Id: Ib51f3ad5611f5614768355eb8533084ba117a8e9
Reviewed-on: https://go-review.googlesource.com/c/go/+/238019
Reviewed-by: Jeremy Faller <jeremy@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
src/cmd/link/internal/ld/elf.go