diff options
author | H.J. Lu <hjl.tools@gmail.com> | 2015-02-27 13:56:44 -0800 |
---|---|---|
committer | H.J. Lu <hjl.tools@gmail.com> | 2015-02-27 14:13:28 -0800 |
commit | ef4ad06fe5a615af9550d74b1b6d546b9dc0a64d (patch) | |
tree | ec538cb7181efe801c012b94bea4d9c257d77a07 /elf/vismain.c | |
parent | 2ca725c594e0c186d928dc0823be7d8b5976112c (diff) | |
download | glibc-ef4ad06fe5a615af9550d74b1b6d546b9dc0a64d.zip glibc-ef4ad06fe5a615af9550d74b1b6d546b9dc0a64d.tar.gz glibc-ef4ad06fe5a615af9550d74b1b6d546b9dc0a64d.tar.bz2 |
Compile vismain with -fPIE and link with -pie
Protocted symbol in shared library can only be accessed from PIE
or shared library. Linker in binutils 2.26 enforces it. We must
compile vismain with -fPIE and link it with -pie.
[BZ #17711]
* elf/Makefile (tests): Add vismain only if PIE is enabled.
(tests-pie): Add vismain.
(CFLAGS-vismain.c): New.
* elf/vismain.c: Add comments for PIE requirement.
Diffstat (limited to 'elf/vismain.c')
-rw-r--r-- | elf/vismain.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/elf/vismain.c b/elf/vismain.c index dfcaeeb..05b3748 100644 --- a/elf/vismain.c +++ b/elf/vismain.c @@ -15,6 +15,11 @@ License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ +/* This file must be compiled as PIE to avoid copy relocation when + accessing protected symbols defined in shared libaries since copy + relocation doesn't work with protected symbols and linker in + binutils 2.26 enforces this rule. */ + #include <stdio.h> #include <stdlib.h> #include <string.h> |