1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-12-24 17:51:17 +03:00

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.
This commit is contained in:
H.J. Lu
2015-02-27 13:56:44 -08:00
parent 2ca725c594
commit ef4ad06fe5
4 changed files with 21 additions and 5 deletions

View File

@@ -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>