Commit b0d175e
committed
cmd/link: add option to enable full RELRO for ELF
-bindnow linker option enables full RELRO on ELF targets.
This options defaults to false and preserves
current behavior - partial relro for buildmode=pie.
Also, the following changes were made to align
internal linker's behavior with external ELF linkers:
- GNU_RELRO segment is marked Read-only
- .dynamic is a relro section for partial and full RELRO
- .got is a relro section for partial and full RELRO
- .got.plt is a relro section for full RELRO only
Supersedes #45681 (golang.org/cl/312509)1 parent ee522e2 commit b0d175e
File tree
6 files changed
+37
-11
lines changed- src/cmd
- go/internal/work
- link
- internal/ld
6 files changed
+37
-11
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
206 | 206 | | |
207 | 207 | | |
208 | 208 | | |
209 | | - | |
210 | | - | |
| 209 | + | |
211 | 210 | | |
212 | 211 | | |
213 | 212 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
167 | 167 | | |
168 | 168 | | |
169 | 169 | | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
170 | 174 | | |
171 | 175 | | |
172 | 176 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
| 48 | + | |
| 49 | + | |
48 | 50 | | |
49 | 51 | | |
50 | 52 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1044 | 1044 | | |
1045 | 1045 | | |
1046 | 1046 | | |
1047 | | - | |
1048 | | - | |
1049 | | - | |
1050 | | - | |
| 1047 | + | |
| 1048 | + | |
| 1049 | + | |
| 1050 | + | |
| 1051 | + | |
| 1052 | + | |
| 1053 | + | |
| 1054 | + | |
| 1055 | + | |
| 1056 | + | |
1051 | 1057 | | |
1052 | 1058 | | |
1053 | 1059 | | |
| |||
1095 | 1101 | | |
1096 | 1102 | | |
1097 | 1103 | | |
| 1104 | + | |
1098 | 1105 | | |
1099 | 1106 | | |
1100 | 1107 | | |
| |||
1533 | 1540 | | |
1534 | 1541 | | |
1535 | 1542 | | |
1536 | | - | |
| 1543 | + | |
| 1544 | + | |
| 1545 | + | |
| 1546 | + | |
| 1547 | + | |
1537 | 1548 | | |
1538 | 1549 | | |
1539 | 1550 | | |
| |||
1546 | 1557 | | |
1547 | 1558 | | |
1548 | 1559 | | |
1549 | | - | |
| 1560 | + | |
| 1561 | + | |
| 1562 | + | |
| 1563 | + | |
| 1564 | + | |
1550 | 1565 | | |
1551 | 1566 | | |
1552 | 1567 | | |
| |||
1568 | 1583 | | |
1569 | 1584 | | |
1570 | 1585 | | |
1571 | | - | |
| 1586 | + | |
| 1587 | + | |
1572 | 1588 | | |
1573 | | - | |
| 1589 | + | |
| 1590 | + | |
| 1591 | + | |
1574 | 1592 | | |
1575 | 1593 | | |
1576 | 1594 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1558 | 1558 | | |
1559 | 1559 | | |
1560 | 1560 | | |
1561 | | - | |
| 1561 | + | |
1562 | 1562 | | |
1563 | 1563 | | |
1564 | 1564 | | |
1565 | 1565 | | |
| 1566 | + | |
1566 | 1567 | | |
| 1568 | + | |
1567 | 1569 | | |
1568 | 1570 | | |
1569 | 1571 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
| 64 | + | |
64 | 65 | | |
65 | 66 | | |
66 | 67 | | |
| |||
0 commit comments