Bug#633477: [gcc-4.6] -flto generate executable stack
Package: gcc-4.6
Version: 4.6.1-2
Severity: normal
I played around with flto, but noticed that it enables -Wl,-z,execstack
$ echo "int main(void) { return 0; }" > test.c
$ gcc test.c -o noflto
$ gcc -flto test.c -o flto
$ scanelf -e *flto
TYPE STK/REL/PTL FILE
ET_EXEC RWX --- RW- flto
ET_EXEC RW- --- RW- noflto
This is not what I expect that it does and probably against many security
policies.
--- System information. ---
Architecture: amd64
Kernel: Linux 3.0.0-rc4-amd64
Debian Release: wheezy/sid
500 unstable www.debian-multimedia.org
500 unstable ftp.debian.org
500 testing ftp.debian.org
1 experimental www.debian-multimedia.org
1 experimental ftp.debian.org
--- Package information. ---
Depends (Version) | Installed
================================-+-===============
gcc-4.6-base (= 4.6.1-2) | 4.6.1-2
cpp-4.6 (= 4.6.1-2) | 4.6.1-2
binutils (>= 2.21.51~) | 2.21.52.20110707-1
libgcc1 (>= 1:4.6.1-2) | 1:4.6.1-2
libgomp1 (>= 4.6.1-2) | 4.6.1-2
libquadmath0 (>= 4.6.1-2) | 4.6.1-2
libc6 (>= 2.11) | 2.13-10
libcloog-ppl0 (>= 0.15.9-3~) | 0.15.9-3
libgmp10 | 2:5.0.1+dfsg-7
libgmpxx4ldbl | 2:5.0.1+dfsg-7
libmpc2 | 0.9-3
libmpfr4 | 3.0.1-4
libppl-c4 | 0.11.2-3
libppl9 | 0.11.2-3
zlib1g (>= 1:1.1.4) | 1:1.2.3.4.dfsg-3
Recommends (Version) | Installed
==========================-+-============
libc6-dev (>= 2.13-5) | 2.13-10
Suggests (Version) | Installed
=====================================-+-==============
gcc-4.6-multilib | 4.6.1-2
libmudflap0-4.6-dev (>= 4.6.1-2) |
gcc-4.6-doc (>= 4.6.0-12) |
gcc-4.6-locales (>= 4.6.0-12) |
libgcc1-dbg |
libgomp1-dbg |
libquadmath0-dbg |
libmudflap0-dbg |
binutils-gold (>= 2.21.51~) |
--
Emil Langrock
Reply to: