Skip to content

Commit b85c7f7

Browse files
committed
cmd/link: change flag from -relro to -bindnow
Signed-off-by: Morten Linderud <[email protected]>
1 parent b2601e7 commit b85c7f7

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

src/cmd/link/doc.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,9 @@ Flags:
8787
instead of $GOROOT/pkg/$GOOS_$GOARCH.
8888
-k symbol
8989
Set field tracking symbol. Use this flag when GOEXPERIMENT=fieldtrack is set.
90-
-relro
91-
Enable RELRO (default true).
90+
-bindnow
91+
When linking externally and marking variables read-only after relocation, also require
92+
immediate function binding (default true)
9293
-libgcc file
9394
Set name of compiler support library.
9495
This is only used in internal link mode.

src/cmd/link/internal/ld/lib.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1408,7 +1408,7 @@ func (ctxt *Link) hostlink() {
14081408
addRELROargs := func(argv []string) []string {
14091409
relro := "-Wl,-z,relro"
14101410
// Enable Full RELRO
1411-
if *FlagRelro {
1411+
if *FlagBindNow {
14121412
relro += ",-z,now"
14131413
}
14141414
argv = append(argv, relro)

src/cmd/link/internal/ld/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ var (
9595
FlagDebugTextSize = flag.Int("debugtextsize", 0, "debug text section max size")
9696
flagDebugNosplit = flag.Bool("debugnosplit", false, "dump nosplit call graph")
9797
FlagStrictDups = flag.Int("strictdups", 0, "sanity check duplicate symbol contents during object file reading (1=warn 2=err).")
98-
FlagRelro = flag.Bool("relro", true, "enable RELRO for buildmode=pie")
98+
FlagBindNow = flag.Bool("bindnow", true, "bind function calls when linking externally")
9999
FlagRound = flag.Int("R", -1, "set address rounding `quantum`")
100100
FlagTextAddr = flag.Int64("T", -1, "set text segment `address`")
101101
flagEntrySymbol = flag.String("E", "", "set `entry` symbol name")

0 commit comments

Comments
 (0)