Browse Source
Move .got .got.plt before .data so .got can be protected with -zrelro. And the first two entries of .got.plt (_dl_runtime_resolve and link map) are placed within the relro region.master
committed by
liuzhensong
5 changed files with 29 additions and 1 deletions
@ -0,0 +1,16 @@ |
|||
# line 11 test the first two entries of .got.plt in relro region |
|||
# relro segment size is .dynamic size + .got size + 0x10 |
|||
# line 13 test .got .got.plt before .got |
|||
# line 15 test .got in relro segment |
|||
#as: |
|||
#ld: -shared -z relro --hash-style=both |
|||
#readelf: -l --wide |
|||
#skip: loongarch32-*-* |
|||
|
|||
#... |
|||
GNU_RELRO 0x003c10 0x0000000000007c10 0x0000000000007c10 0x0003f0 0x0003f0 R 0x1 |
|||
#... |
|||
01 .dynamic .got .got.plt .data |
|||
#... |
|||
03 .dynamic .got |
|||
#pass |
|||
@ -0,0 +1,6 @@ |
|||
.text |
|||
b foo |
|||
.section .got |
|||
.space 0x2a8, 4 |
|||
.data |
|||
.zero 24 |
|||
Loading…
Reference in new issue