'gcc/ld ignored full relro options

I'm trying to compile a full RELRO program on my OpenSUSE 13.2. With the following command $ gcc a.c -z,relro,-z,now -o a

I got the warning /usr/lib64/gcc/x86_64-suse-linux/4.8/../../../../x86_64-suse-linux/bin/ld: warning: -z ,relro,-z,now ignored.

And the generated binary is still partial RELRO.

My GCC and ld version gcc (SUSE Linux) 4.8.3 20140627 [gcc-4_8-branch revision 212064] GNU ld (GNU Binutils; openSUSE 13.2) 2.24.0.20140403-6.1 What's wrong with my gcc ...



Solution 1:[1]

The following worked for me:

gcc -m32 -g -Wl,-z,relro,-z,now -o test test.c

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Dharman