diff options
| author | Ulf Hermann <[email protected]> | 2017-02-24 13:11:03 +0100 |
|---|---|---|
| committer | Ulf Hermann <[email protected]> | 2017-04-28 09:21:43 +0000 |
| commit | 76acde30382254f7ca51af67ea91433719080edd (patch) | |
| tree | 71564ca688cff175381ecd3e51b1c8e2507db998 /libelf | |
| parent | ffb6a77fc4f0533126a3ff49ec5c03ef8e674520 (diff) | |
Check for -z,defs, -z,relro, -fPIC, -fPIE before using them
On windows those aren't needed because the link results are no ELF
files and all code is position independent anyway. gcc then complains
about them, which is in turn caught by -Werror.
Change-Id: Ie3d600b7c430698fc3d867a986a4d48f7ad1bbec
Reviewed-by: Christian Kandeler <[email protected]>
Diffstat (limited to 'libelf')
| -rw-r--r-- | libelf/ChangeLog | 4 | ||||
| -rw-r--r-- | libelf/Makefile.am | 6 |
2 files changed, 7 insertions, 3 deletions
diff --git a/libelf/ChangeLog b/libelf/ChangeLog index 9165634a..1c6cce29 100644 --- a/libelf/ChangeLog +++ b/libelf/ChangeLog @@ -1,5 +1,9 @@ 2017-04-27 Ulf Hermann <[email protected]> + * Makefile.am: Use fpic_CFLAGS and dso_LDFLAGS. + +2017-04-27 Ulf Hermann <[email protected]> + * elf_getarsym.c: Don't replace rawmemchr. * elf_strptr.c: Don't replace memrchr. diff --git a/libelf/Makefile.am b/libelf/Makefile.am index d141c641..78d68532 100644 --- a/libelf/Makefile.am +++ b/libelf/Makefile.am @@ -29,7 +29,7 @@ ## include $(top_srcdir)/config/eu.am if BUILD_STATIC -AM_CFLAGS += -fPIC +AM_CFLAGS += $(fpic_CFLAGS) endif GCC_INCLUDE = -I$(shell $(CC) -print-file-name=include) VERSION = 1 @@ -105,9 +105,9 @@ endif libelf_so_SOURCES = libelf.so$(EXEEXT): libelf_pic.a libelf.map - $(AM_V_CCLD)$(LINK) -shared -o $@ -Wl,--whole-archive,$<,--no-whole-archive \ + $(AM_V_CCLD)$(LINK) $(dso_LDFLAGS) -o $@ -Wl,--whole-archive,$<,--no-whole-archive \ -Wl,--version-script,$(srcdir)/libelf.map,--no-undefined \ - -Wl,--soname,$@.$(VERSION),-z,defs,-z,relro $(libelf_so_LDLIBS) + -Wl,--soname,$@.$(VERSION) $(libelf_so_LDLIBS) @$(textrel_check) $(AM_V_at)ln -fs $@ $@.$(VERSION) |
