diff options
author | Ulf Hermann <ulf.hermann@qt.io> | 2017-08-18 12:41:11 +0200 |
---|---|---|
committer | Mark Wielaard <mark@klomp.org> | 2017-08-18 22:29:46 +0200 |
commit | 07737584e73714eff3481fcf17f9f0331c8a5b88 (patch) | |
tree | 67958824d82e2be085ac94e75aa2e047d4166704 /backends | |
parent | 6d2e7e7100429df3d548251e9685a1eb7bb434cb (diff) | |
download | elfutils-07737584e73714eff3481fcf17f9f0331c8a5b88.tar.gz |
Check for -z,defs, -z,relro, -fPIC, -fPIE before using them
Those flags are not available on all platforms, and omitting them when
not available will not cause any harm. In particular:
-z,defs disallows undefined symbols in object files. This option is
unsupported if the target binary format enforces the same condition
already. Furthermore it is only a compile time sanity check. When it is
omitted, the same binary is produced.
-z,relro instructs the loader to mark sections read-only after loading
the library, where possible. This is a hardening mechanism. If it is
unavailable, the functionality of the code is not affected in any way.
-fPIC instructs the compiler to produce position independent code. While
this is preferable to relocatable code, relocatable code also works and
may even be faster. Relocatable code might just be loaded into memory
multiple times for different processes.
-fPIE is the same thing as -fPIC for executables rather than shared
libraries.
Signed-off-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'backends')
-rw-r--r-- | backends/ChangeLog | 4 | ||||
-rw-r--r-- | backends/Makefile.am | 4 |
2 files changed, 6 insertions, 2 deletions
diff --git a/backends/ChangeLog b/backends/ChangeLog index a66e923e..79b50ebf 100644 --- a/backends/ChangeLog +++ b/backends/ChangeLog @@ -1,3 +1,7 @@ +2017-04-27 Ulf Hermann <ulf.hermann@qt.io> + + * Makefile.am: Use dso_LDFLAGS. + 2017-07-27 Mark Wielaard <mark@klomp.org> * sparc_reloc.def: GOTDATA_OP_HIX22, GOTDATA_OP_LOX10 and diff --git a/backends/Makefile.am b/backends/Makefile.am index 37dc2d20..0fde0cb0 100644 --- a/backends/Makefile.am +++ b/backends/Makefile.am @@ -129,10 +129,10 @@ libebl_%.so libebl_%.map: libebl_%_pic.a $(libelf) $(libdw) $(libeu) @rm -f $(@:.so=.map) $(AM_V_at)echo 'ELFUTILS_$(PACKAGE_VERSION) { global: $*_init; local: *; };' \ > $(@:.so=.map) - $(AM_V_CCLD)$(LINK) -shared -o $(@:.map=.so) \ + $(AM_V_CCLD)$(LINK) $(dso_LDFLAGS) -o $(@:.map=.so) \ -Wl,--whole-archive $< $(cpu_$*) -Wl,--no-whole-archive \ -Wl,--version-script,$(@:.so=.map),--no-undefined \ - -Wl,-z,defs,-z,relro -Wl,--as-needed $(libelf) $(libdw) $(libeu) + -Wl,--as-needed $(libelf) $(libdw) $(libeu) @$(textrel_check) libebl_i386.so: $(cpu_i386) |