]> Cypherpunks repositories - gostls13.git/commit
cmd/link: round up default start address to alignment
authorCherry Mui <cherryyz@google.com>
Wed, 13 Sep 2023 16:50:17 +0000 (12:50 -0400)
committerCherry Mui <cherryyz@google.com>
Wed, 13 Sep 2023 19:32:19 +0000 (19:32 +0000)
commitd66fc90a0daf879ca0b4d9be43c123b13ed59853
tree04b84c204cb68aaf8ea4b9f685bd0fd8493d15ea
parentda13da1fceff5439af70571826e2dd35925d86a5
cmd/link: round up default start address to alignment

If the -R flag (the segment alignment) is specified but the -T
flag (start address) is not, currently the default start address
may be under-aligned, and some math in the linker may be broken.
Round up the start address to align it.

Fixes #62064.

Change-Id: I3b98c9d0cf7d3cd944b9436a36808899d2e52572
Reviewed-on: https://go-review.googlesource.com/c/go/+/527822
Run-TryBot: Cherry Mui <cherryyz@google.com>
Reviewed-by: Than McIntosh <thanm@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
14 files changed:
src/cmd/link/elf_test.go
src/cmd/link/internal/amd64/obj.go
src/cmd/link/internal/arm/obj.go
src/cmd/link/internal/arm64/obj.go
src/cmd/link/internal/ld/main.go
src/cmd/link/internal/ld/pe.go
src/cmd/link/internal/ld/xcoff.go
src/cmd/link/internal/loong64/obj.go
src/cmd/link/internal/mips/obj.go
src/cmd/link/internal/mips64/obj.go
src/cmd/link/internal/ppc64/obj.go
src/cmd/link/internal/riscv64/obj.go
src/cmd/link/internal/s390x/obj.go
src/cmd/link/internal/x86/obj.go