diff options
| author | Ulf Hermann <[email protected]> | 2017-02-17 16:11:28 +0100 |
|---|---|---|
| committer | Mark Wielaard <[email protected]> | 2017-07-24 11:01:09 +0200 |
| commit | 8abf0b5b580094af36b9dc4ed6748379caa32a0e (patch) | |
| tree | bca019b54b6bd1441b2eb68acf7c50c52a4c27a9 /libelf/Makefile.am | |
| parent | 1dd301b7c302b9df980946e2d04ca99748754991 (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/Makefile.am')
| -rw-r--r-- | libelf/Makefile.am | 14 |
1 files changed, 9 insertions, 5 deletions
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) |
