summaryrefslogtreecommitdiff
path: root/libasm/Makefile.am
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2017-02-17 16:11:28 +0100
committerMark Wielaard <mark@klomp.org>2017-07-24 11:01:09 +0200
commit8abf0b5b580094af36b9dc4ed6748379caa32a0e (patch)
treebca019b54b6bd1441b2eb68acf7c50c52a4c27a9 /libasm/Makefile.am
parent1dd301b7c302b9df980946e2d04ca99748754991 (diff)
downloadelfutils-8abf0b5b580094af36b9dc4ed6748379caa32a0e.tar.gz
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 <ulf.hermann@qt.io>
Diffstat (limited to 'libasm/Makefile.am')
-rw-r--r--libasm/Makefile.am14
1 files changed, 8 insertions, 6 deletions
diff --git a/libasm/Makefile.am b/libasm/Makefile.am
index 8094b05c..9effa6c5 100644
--- a/libasm/Makefile.am
+++ b/libasm/Makefile.am
@@ -55,17 +55,19 @@ libasm_a_SOURCES = asm_begin.c asm_abort.c asm_end.c asm_error.c \
libasm_pic_a_SOURCES =
am_libasm_pic_a_OBJECTS = $(libasm_a_SOURCES:.c=.os)
-libasm_so_LDLIBS =
+libasm_so_DEPS = ../lib/libeu.a ../libebl/libebl.a ../libelf/libelf.so ../libdw/libdw.so
+libasm_so_LDLIBS = $(libasm_so_DEPS)
if USE_LOCKS
libasm_so_LDLIBS += -lpthread
endif
+libasm_so_LIBS = libasm_pic.a
libasm_so_SOURCES =
-libasm.so$(EXEEXT): libasm_pic.a libasm.map
- $(AM_V_CCLD)$(LINK) -shared -o $@ -Wl,--whole-archive,$<,--no-whole-archive \
- -Wl,--version-script,$(srcdir)/libasm.map,--no-undefined \
- -Wl,--soname,$@.$(VERSION) \
- ../libebl/libebl.a ../libelf/libelf.so ../libdw/libdw.so \
+libasm.so$(EXEEXT): $(srcdir)/libasm.map $(libasm_so_LIBS) $(libasm_so_DEPS)
+ $(AM_V_CCLD)$(LINK) -shared -o $@ \
+ -Wl,--soname,$@.$(VERSION),-z,defs,-z,relro \
+ -Wl,--version-script,$<,--no-undefined \
+ -Wl,--whole-archive $(libasm_so_LIBS) -Wl,--no-whole-archive \
$(libasm_so_LDLIBS)
@$(textrel_check)
$(AM_V_at)ln -fs $@ $@.$(VERSION)