summaryrefslogtreecommitdiffstats
path: root/libelf
diff options
context:
space:
mode:
authorUlf Hermann <[email protected]>2017-02-17 16:11:28 +0100
committerMark Wielaard <[email protected]>2017-07-24 11:01:09 +0200
commit8abf0b5b580094af36b9dc4ed6748379caa32a0e (patch)
treebca019b54b6bd1441b2eb68acf7c50c52a4c27a9 /libelf
parent1dd301b7c302b9df980946e2d04ca99748754991 (diff)
Unify linking of libasm, libelf, libdw, backends
Link them all with -z,defs,-z,relro,--no-undefined, provide complete dependencies for the link steps, and add libeu.a to each one. libeu.a contains useful library functionality that each of them might use. The linker will strip unneeded symbols, so linking it in won't hurt even if none of the functions are used. Signed-off-by: Ulf Hermann <[email protected]>
Diffstat (limited to 'libelf')
-rw-r--r--libelf/ChangeLog8
-rw-r--r--libelf/Makefile.am14
2 files changed, 17 insertions, 5 deletions
diff --git a/libelf/ChangeLog b/libelf/ChangeLog
index 594bec99..214a4f7e 100644
--- a/libelf/ChangeLog
+++ b/libelf/ChangeLog
@@ -1,3 +1,11 @@
+2017-02-17 Ulf hermann <[email protected]>
+
+ * Makefile.am: Add libelf_so_DEPS, which include libeu.a,
+ libelf_so_LIBS.
+ (libelf_so_LDLIBS): Add $(libelf_so_DEPS).
+ (libelf.so$(EXEEXT): Use $(libelf_so_LIBS), require libelf.map
+ from the right directory.
+
2017-04-20 Ulf Hermann <[email protected]>
* libelfP.h: Don't include config.h.
diff --git a/libelf/Makefile.am b/libelf/Makefile.am
index 167a8322..88c1edd7 100644
--- a/libelf/Makefile.am
+++ b/libelf/Makefile.am
@@ -95,16 +95,20 @@ libelf_a_SOURCES = elf_version.c elf_hash.c elf_error.c elf_fill.c \
libelf_pic_a_SOURCES =
am_libelf_pic_a_OBJECTS = $(libelf_a_SOURCES:.c=.os)
-libelf_so_LDLIBS = -lz
+libelf_so_DEPS = ../lib/libeu.a
+libelf_so_LDLIBS = $(libelf_so_DEPS) -lz
if USE_LOCKS
libelf_so_LDLIBS += -lpthread
endif
+libelf_so_LIBS = libelf_pic.a
libelf_so_SOURCES =
-libelf.so$(EXEEXT): libelf_pic.a libelf.map
- $(AM_V_CCLD)$(LINK) -shared -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)
+libelf.so$(EXEEXT): $(srcdir)/libelf.map $(libelf_so_LIBS) $(libelf_so_DEPS)
+ $(AM_V_CCLD)$(LINK) -shared -o $@ \
+ -Wl,--soname,$@.$(VERSION),-z,defs,-z,relro \
+ -Wl,--version-script,$<,--no-undefined \
+ -Wl,--whole-archive $(libelf_so_LIBS) -Wl,--no-whole-archive \
+ $(libelf_so_LDLIBS)
@$(textrel_check)
$(AM_V_at)ln -fs $@ $@.$(VERSION)