Je suis en train de compiler avec -msecure-plt, et bien que la compilation se termine bien, quand on regarde les cartes mémoire, on dirait que le drapeau ne fait rien. Je suppose qu'il ne fait rien parce que les sections get et plt sont toujours en RWXP
.Vérification Powerpc-msecure-plt
Dump of assembler code for function main:
0x1000061c <+0>: stwu r1,-16(r1)
0x10000620 <+4>: mflr r0
0x10000624 <+8>: stw r0,20(r1)
0x10000628 <+12>: stw r31,12(r1)
0x1000062c <+16>: mr r31,r1
0x10000630 <+20>: bl 0x1001096c <[email protected]>
0x10000634 <+24>: mr r10,r3
0x10000638 <+28>: lis r9,4096
0x1000063c <+32>: addi r3,r9,2048
0x10000640 <+36>: mr r4,r10
0x10000644 <+40>: crclr 4*cr1+eq
0x10000648 <+44>: bl 0x10010964 <[email protected]>
=> 0x1000064c <+48>: li r9,1
0x10000650 <+52>: mr r3,r9
0x10000654 <+56>: addi r11,r31,16
0x10000658 <+60>: lwz r0,4(r11)
0x1000065c <+64>: mtlr r0
0x10000660 <+68>: lwz r31,-4(r11)
0x10000664 <+72>: mr r1,r11
0x10000668 <+76>: blr
avec /proc/<pid>/maps
montrant une carte mémoire de
00100000-00103000 r-xp 00000000 00:00 0 [vdso]
0fe40000-0ffb8000 r-xp 00000000 00:01 6285 /lib/libc-2.22.so
0ffb8000-0ffc7000 ---p 00178000 00:01 6285 /lib/libc-2.22.so
0ffc7000-0ffc9000 r--p 00177000 00:01 6285 /lib/libc-2.22.so
0ffc9000-0ffcd000 rwxp 00179000 00:01 6285 /lib/libc-2.22.so
0ffcd000-0ffcf000 rwxp 00000000 00:00 0
0ffdf000-0ffe0000 r-xp 00000000 00:01 5928 /lib/libmaintest.so
0ffe0000-0ffef000 ---p 00001000 00:01 5928 /lib/libmaintest.so
0ffef000-0fff0000 rwxp 00000000 00:01 5928 /lib/libmaintest.so
10000000-10001000 r-xp 00000000 00:01 5934 /root/main
10010000-10011000 rwxp 00000000 00:01 5934 /root/main
b7860000-b7882000 r-xp 00000000 00:01 6240 /lib/ld-2.22.so
b7890000-b7892000 rw-p 00000000 00:00 0
b7892000-b7893000 r--p 00022000 00:01 6240 /lib/ld-2.22.so
b7893000-b7895000 rwxp 00023000 00:01 6240 /lib/ld-2.22.so
bff1a000-bff3b000 rw-p 00000000 00:00 0 [stack]
qui colle à la fois de la parcelle sauts en plein milieu d'une section rwx
. Est-ce que j'interprète mal cette information?