summaryrefslogtreecommitdiffstats
path: root/libdw
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 /libdw
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 'libdw')
-rw-r--r--libdw/ChangeLog9
-rw-r--r--libdw/Makefile.am15
2 files changed, 18 insertions, 6 deletions
diff --git a/libdw/ChangeLog b/libdw/ChangeLog
index 1e282e4e..8eda70cd 100644
--- a/libdw/ChangeLog
+++ b/libdw/ChangeLog
@@ -1,3 +1,12 @@
+2017-02-17 Ulf Hermann <[email protected]>
+
+ * Makefile.am: Add libdw_so_LIBS to specify the archives libdw is is
+ made of, libdw_so_DEPS for libraries it depends on (including
+ libeu.a), libdw_so_LDLIBS to specify libraries libdw links against.
+ (libdw.so$(EXEEXT)): Add $(libdw_so_LDLIBS), remove enumeration of
+ library dependencies, use libdw_so_LIBS rather than relying on the
+ order of dependencies specified, add -z,relro.
+
2017-04-20 Ulf Hermann <[email protected]>
* libdw.h: Remove attribute macro declarations and use
diff --git a/libdw/Makefile.am b/libdw/Makefile.am
index 082d96c7..634ac2ec 100644
--- a/libdw/Makefile.am
+++ b/libdw/Makefile.am
@@ -102,17 +102,20 @@ endif
libdw_pic_a_SOURCES =
am_libdw_pic_a_OBJECTS = $(libdw_a_SOURCES:.c=.os)
+libdw_so_LIBS = libdw_pic.a ../libdwelf/libdwelf_pic.a \
+ ../libdwfl/libdwfl_pic.a ../libebl/libebl.a
+libdw_so_DEPS = ../lib/libeu.a ../libelf/libelf.so
+libdw_so_LDLIBS = $(libdw_so_DEPS) -ldl -lz $(argp_LDADD) $(zip_LIBS)
libdw_so_SOURCES =
-libdw.so$(EXEEXT): $(srcdir)/libdw.map libdw_pic.a ../libdwelf/libdwelf_pic.a \
- ../libdwfl/libdwfl_pic.a ../libebl/libebl.a \
- ../libelf/libelf.so
+libdw.so$(EXEEXT): $(srcdir)/libdw.map $(libdw_so_LIBS) $(libdw_so_DEPS)
# The rpath is necessary for libebl because its $ORIGIN use will
# not fly in a setuid executable that links in libdw.
- $(AM_V_CCLD)$(LINK) -shared -o $@ -Wl,--soname,$@.$(VERSION),-z,defs \
+ $(AM_V_CCLD)$(LINK) -shared -o $@ \
+ -Wl,--soname,$@.$(VERSION),-z,defs,-z,relro \
-Wl,--enable-new-dtags,-rpath,$(pkglibdir) \
-Wl,--version-script,$<,--no-undefined \
- -Wl,--whole-archive $(filter-out $<,$^) -Wl,--no-whole-archive\
- -ldl -lz $(argp_LDADD) $(zip_LIBS)
+ -Wl,--whole-archive $(libdw_so_LIBS) -Wl,--no-whole-archive \
+ $(libdw_so_LDLIBS)
@$(textrel_check)
$(AM_V_at)ln -fs $@ $@.$(VERSION)