3 @@ -20,6 +20,7 @@ dnl You should have received a copy of
4 dnl along with this program. If not, see <http://www.gnu.org/licenses/>.
5 AC_INIT([elfutils],[0.189],[https://sourceware.org/bugzilla],[elfutils],[http://elfutils.org/])
7 +AC_CONFIG_MACRO_DIRS([m4])
8 dnl Workaround for older autoconf < 2.64
9 m4_ifndef([AC_PACKAGE_URL],
10 [AC_DEFINE([PACKAGE_URL], ["http://elfutils.org/"],
11 @@ -43,16 +44,17 @@ elif test "x$program_prefix" = "x"; then
14 AC_CONFIG_AUX_DIR([config])
15 -AC_CONFIG_FILES([config/Makefile])
16 +AC_CONFIG_FILES([config/Makefile libgnu/Makefile])
18 AC_COPYRIGHT([Copyright (C) 1996-2023 The elfutils developers.])
19 -AC_PREREQ(2.63) dnl Minimum Autoconf version required.
20 +AC_PREREQ(2.64) dnl Minimum Autoconf version required.
22 dnl We use GNU make extensions; automake 1.10 defaults to -Wportability.
23 AM_INIT_AUTOMAKE([gnits 1.11 -Wno-portability dist-bzip2 no-dist-gzip parallel-tests])
26 AM_SILENT_RULES([yes])
27 +AC_USE_SYSTEM_EXTENSIONS()
29 AC_CONFIG_SRCDIR([libelf/libelf.h])
30 AC_CONFIG_FILES([Makefile])
31 @@ -89,12 +91,14 @@ AS_IF([test "$use_locks" = yes],
32 AH_TEMPLATE([USE_LOCKS], [Defined if libraries should be thread-safe.])
34 m4_version_prereq([2.70], [AC_PROG_CC], [AC_PROG_CC_C99])
40 AC_PROG_LEX([noyywrap])
41 # Only available since automake 1.12
42 m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
44 AC_CHECK_TOOL([READELF], [readelf])
45 AC_CHECK_TOOL([NM], [nm])
47 @@ -195,7 +199,6 @@ AC_CACHE_CHECK([whether the compiler gen
48 AC_LINK_IFELSE([AC_LANG_PROGRAM()],[ac_cv_buildid=yes; $READELF -n conftest$EXEEXT | grep -q NT_GNU_BUILD_ID || ac_cv_buildid=no],AC_MSG_FAILURE([unexpected compile failure]))])
49 if test "$ac_cv_buildid" = "no"; then
50 AC_MSG_WARN([compiler doesn't generate build-id by default])
51 - LDFLAGS="$LDFLAGS -Wl,--build-id"
54 ZRELRO_LDFLAGS="-Wl,-z,relro"
55 @@ -635,36 +638,6 @@ AC_COMPILE_IFELSE([AC_LANG_SOURCE([])],
56 CFLAGS="$old_CFLAGS"])
57 AS_IF([test "x$ac_cv_fno_addrsig" = "xyes"], CFLAGS="$CFLAGS -fno-addrsig")
60 -AC_SEARCH_LIBS([argp_parse], [argp])
62 -case "$ac_cv_search_argp_parse" in
63 - no) AC_MSG_FAILURE([failed to find argp_parse]) ;;
64 - -l*) argp_LDADD="$ac_cv_search_argp_parse" ;;
67 -AC_SUBST([argp_LDADD])
70 -AC_SEARCH_LIBS([fts_close], [fts])
72 -case "$ac_cv_search_fts_close" in
73 - no) AC_MSG_FAILURE([failed to find fts_close]) ;;
74 - -l*) fts_LIBS="$ac_cv_search_fts_close" ;;
80 -AC_SEARCH_LIBS([_obstack_free], [obstack])
82 -case "$ac_cv_search__obstack_free" in
83 - no) AC_MSG_FAILURE([failed to find _obstack_free]) ;;
84 - -l*) obstack_LIBS="$ac_cv_search__obstack_free" ;;
87 -AC_SUBST([obstack_LIBS])
89 dnl The directories with content.
94 @@ -26,11 +26,11 @@ AM_MAKEFLAGS = --no-print-directory
96 pkginclude_HEADERS = version.h
98 -SUBDIRS = config lib libelf libcpu backends libebl libdwelf libdwfl libdw \
99 - libasm debuginfod src po doc tests
100 +SUBDIRS = libgnu config lib libelf libcpu backends libebl libdwelf libdwfl libdw
102 EXTRA_DIST = elfutils.spec GPG-KEY NOTES CONTRIBUTING \
103 - COPYING COPYING-GPLV2 COPYING-LGPLV3
104 + COPYING COPYING-GPLV2 COPYING-LGPLV3 \
107 # Make sure the test install uses lib64 when $LIB will yield lib64.
108 # Make sure the test build uses the same compiler, which on e.g. ppc64
109 --- a/libelf/elf_update.c
110 +++ b/libelf/elf_update.c
115 +#include "elf_fill.c"
118 +static int posix_fallocate(int fd, off_t offset, off_t len)
122 + if (!__builtin_saddll_overflow(offset, len, &c_test)) {
123 + fstore_t store = {F_ALLOCATECONTIG, F_PEOFPOSMODE, 0, offset + len, 0};
124 + // Try to get a continuous chunk of disk space
125 + ret = fcntl(fd, F_PREALLOCATE, &store);
127 + // OK, perhaps we are too fragmented, allocate non-continuous
128 + store.fst_flags = F_ALLOCATEALL;
129 + ret = fcntl(fd, F_PREALLOCATE, &store);
134 + ret = ftruncate(fd, offset + len);
136 + // offset+len would overflow.
144 write_file (Elf *elf, int64_t size, int change_bo, size_t shnum)
145 --- a/lib/eu-config.h
146 +++ b/lib/eu-config.h
148 # define rwlock_unlock(lock) ((void) (lock))
149 #endif /* USE_LOCKS */
151 -#include <libintl.h>
152 +#include <gettext.h>
153 /* gettext helper macros. */
155 #define _(Str) dgettext ("elfutils", Str)
157 /* Compiler-specific definitions. */
159 +#define strong_alias(name, aliasname)
161 #define strong_alias(name, aliasname) \
162 extern __typeof (name) aliasname __attribute__ ((alias (#name)));
166 # define internal_function __attribute__ ((regparm (3), stdcall))
168 #define internal_strong_alias(name, aliasname) \
169 extern __typeof (name) aliasname __attribute__ ((alias (#name))) internal_function;
171 -#ifdef HAVE_VISIBILITY
172 -#define attribute_hidden \
173 - __attribute__ ((visibility ("hidden")))
175 #define attribute_hidden /* empty */
178 #ifdef HAVE_GCC_STRUCT
179 #define attribute_packed \
180 @@ -159,7 +158,7 @@ asm (".section predict_data, \"aw\"; .pr
183 /* Avoid PLT entries. */
185 +#if defined(PIC) && !defined(__APPLE__)
186 # define INTUSE(name) _INTUSE(name)
187 # define _INTUSE(name) __##name##_internal
188 # define INTDEF(name) _INTDEF(name)
194 DEFS = -D_GNU_SOURCE -DHAVE_CONFIG_H -DLOCALEDIR='"${localedir}"'
195 -AM_CPPFLAGS = -I. -I$(srcdir) -I$(top_srcdir)/lib -I..
196 +AM_CPPFLAGS = -I$(top_builddir)/libgnu -I$(top_srcdir)/libgnu -I. -I$(srcdir) -I$(top_srcdir)/lib -I..
198 # Drop the 'u' flag that automake adds by default. It is incompatible
199 # with deterministic archives.
200 --- a/libelf/Makefile.am
201 +++ b/libelf/Makefile.am
202 @@ -34,9 +34,7 @@ endif
206 -lib_LIBRARIES = libelf.a
207 -noinst_LIBRARIES = libelf_pic.a
208 -noinst_DATA = $(noinst_LIBRARIES:_pic.a=.so)
209 +lib_LTLIBRARIES = libelf.la
210 include_HEADERS = libelf.h gelf.h nlist.h
212 noinst_HEADERS = abstract.h common.h exttypes.h gelf_xlate.h libelfP.h \
213 @@ -51,7 +49,8 @@ endif
215 pkginclude_HEADERS = elf-knowledge.h
217 -libelf_a_SOURCES = elf_version.c elf_hash.c elf_error.c elf_fill.c \
218 +libelf_la_LIBADD = ../libgnu/libgnu.la ../lib/libeu.la -lz $(zstd_LIBS) -lpthread
219 +libelf_la_SOURCES = elf_version.c elf_hash.c elf_error.c \
220 elf_begin.c elf_next.c elf_rand.c elf_end.c elf_kind.c \
221 gelf_getclass.c elf_getbase.c elf_getident.c \
222 elf32_fsize.c elf64_fsize.c gelf_fsize.c \
223 @@ -102,37 +101,9 @@ libelf_a_SOURCES = elf_version.c elf_has
224 elf32_getchdr.c elf64_getchdr.c gelf_getchdr.c \
225 elf_compress.c elf_compress_gnu.c
227 -libelf_pic_a_SOURCES =
228 -am_libelf_pic_a_OBJECTS = $(libelf_a_SOURCES:.c=.os)
230 -libelf_so_DEPS = ../lib/libeu.a
231 -libelf_so_LDLIBS = $(libelf_so_DEPS) -lz $(zstd_LIBS)
233 -libelf_so_LDLIBS += -lpthread
236 -libelf_so_LIBS = libelf_pic.a
237 -libelf.so: $(srcdir)/libelf.map $(libelf_so_LIBS) $(libelf_so_DEPS)
238 - $(AM_V_CCLD)$(LINK) $(dso_LDFLAGS) -o $@ \
239 - -Wl,--soname,$@.$(VERSION) \
240 - -Wl,--version-script,$< \
242 - -Wl,--whole-archive $(libelf_so_LIBS) -Wl,--no-whole-archive \
243 - $(libelf_so_LDLIBS)
245 - $(AM_V_at)ln -fs $@ $@.$(VERSION)
247 -install: install-am libelf.so
249 $(mkinstalldirs) $(DESTDIR)$(libdir)
250 - $(INSTALL_PROGRAM) libelf.so $(DESTDIR)$(libdir)/libelf-$(PACKAGE_VERSION).so
251 - ln -fs libelf-$(PACKAGE_VERSION).so $(DESTDIR)$(libdir)/libelf.so.$(VERSION)
252 - ln -fs libelf.so.$(VERSION) $(DESTDIR)$(libdir)/libelf.so
254 uninstall: uninstall-am
255 - rm -f $(DESTDIR)$(libdir)/libelf-$(PACKAGE_VERSION).so
256 - rm -f $(DESTDIR)$(libdir)/libelf.so.$(VERSION)
257 - rm -f $(DESTDIR)$(libdir)/libelf.so
259 EXTRA_DIST = libelf.map
261 -CLEANFILES += $(am_libelf_pic_a_OBJECTS) libelf.so libelf.so.$(VERSION)
262 --- a/backends/i386_auxv.c
263 +++ b/backends/i386_auxv.c
264 @@ -48,5 +48,4 @@ EBLHOOK(auxv_info) (GElf_Xword a_type, c
268 -__typeof (i386_auxv_info) x86_64_auxv_info
269 - __attribute__ ((alias ("i386_auxv_info")));
270 +auxv_info_alias(x86_64)
271 --- a/backends/ppc_regs.c
272 +++ b/backends/ppc_regs.c
273 @@ -204,5 +204,11 @@ ppc_register_info (Ebl *ebl __attribute_
277 -__typeof (ppc_register_info)
278 - ppc64_register_info __attribute__ ((alias ("ppc_register_info")));
280 +ppc64_register_info (Ebl *ebl,
281 + int regno, char *name, size_t namelen,
282 + const char **prefix, const char **setname,
283 + int *bits, int *type)
285 + return ppc_register_info(ebl, regno, name, namelen, prefix, setname, bits, type);
287 --- a/backends/libebl_CPU.h
288 +++ b/backends/libebl_CPU.h
289 @@ -97,4 +97,10 @@ dwarf_is_pointer (int tag)
290 case DW_TAG_reference_type: \
291 case DW_TAG_rvalue_reference_type
293 +#define auxv_info_alias(arch) \
294 + int EBLHOOK_1(arch ## _, auxv_info) (GElf_Xword a_type, const char **name, const char **format) \
296 + return EBLHOOK(auxv_info)(a_type, name, format); \
299 #endif /* libebl_CPU.h */
300 --- a/backends/ppc_auxv.c
301 +++ b/backends/ppc_auxv.c
302 @@ -51,5 +51,4 @@ EBLHOOK(auxv_info) (GElf_Xword a_type, c
306 -__typeof (ppc_auxv_info) ppc64_auxv_info
307 - __attribute__ ((alias ("ppc_auxv_info")));
308 +auxv_info_alias(ppc64)
309 --- a/backends/ppc_cfi.c
310 +++ b/backends/ppc_cfi.c
311 @@ -72,6 +72,7 @@ ppc_abi_cfi (Ebl *ebl __attribute__ ((un
315 -__typeof (ppc_abi_cfi)
317 - __attribute__ ((alias ("ppc_abi_cfi")));
318 +int ppc64_abi_cfi(Ebl *ebl, Dwarf_CIE *abi_info)
320 + return ppc_abi_cfi(ebl, abi_info);
322 --- a/backends/ppc_initreg.c
323 +++ b/backends/ppc_initreg.c
324 @@ -68,9 +68,10 @@ ppc_dwarf_to_regno (Ebl *ebl __attribute
328 -__typeof (ppc_dwarf_to_regno)
329 - ppc64_dwarf_to_regno
330 - __attribute__ ((alias ("ppc_dwarf_to_regno")));
331 +bool ppc64_dwarf_to_regno (Ebl *ebl, unsigned *regno)
333 + return ppc_dwarf_to_regno(ebl, regno);
337 ppc_set_initial_registers_tid (pid_t tid __attribute__ ((unused)),
338 @@ -127,6 +128,7 @@ ppc_set_initial_registers_tid (pid_t tid
339 #endif /* __powerpc__ */
342 -__typeof (ppc_set_initial_registers_tid)
343 - ppc64_set_initial_registers_tid
344 - __attribute__ ((alias ("ppc_set_initial_registers_tid")));
345 +bool ppc64_set_initial_registers_tid(pid_t tid, ebl_tid_registers_t *setfunc, void *arg)
347 + return ppc_set_initial_registers_tid(tid, setfunc, arg);
349 --- a/backends/ppc_attrs.c
350 +++ b/backends/ppc_attrs.c
351 @@ -81,6 +81,9 @@ ppc_check_object_attribute (Ebl *ebl __a
355 -__typeof (ppc_check_object_attribute)
356 - ppc64_check_object_attribute
357 - __attribute__ ((alias ("ppc_check_object_attribute")));
358 +bool ppc64_check_object_attribute(Ebl *ebl,
359 + const char *vendor, int tag, uint64_t value,
360 + const char **tag_name, const char **value_name)
362 + return ppc_check_object_attribute(ebl, vendor, tag, value, tag_name, value_name);
366 @@ -45,4 +45,11 @@ extern char *xasprintf(const char *fmt,
367 extern uint32_t crc32 (uint32_t crc, unsigned char *buf, size_t len);
368 extern int crc32_file (int fd, uint32_t *resp);
371 +static inline void tdestroy(void *root __attribute__ ((unused)),
372 + void (*freekey)(void *) __attribute__ ((unused)))
378 --- a/libdwfl/libdwflP.h
379 +++ b/libdwfl/libdwflP.h
390 +++ b/lib/stdio_ext.h
394 +#include_next <stdio_ext.h>
396 +#define __fsetlocking(...) 0
410 /* Known location expressions already decoded. */
411 --- a/libdw/Makefile.am
412 +++ b/libdw/Makefile.am
413 @@ -34,14 +34,12 @@ endif
414 AM_CPPFLAGS += -I$(srcdir)/../libebl -I$(srcdir)/../libelf -I$(srcdir)/../libdwelf -pthread
417 -lib_LIBRARIES = libdw.a
418 -noinst_LIBRARIES = libdw_pic.a
419 -noinst_DATA = $(noinst_LIBRARIES:_pic.a=.so)
420 +lib_LTLIBRARIES = libdw.la
422 include_HEADERS = dwarf.h
423 pkginclude_HEADERS = libdw.h known-dwarf.h
425 -libdw_a_SOURCES = dwarf_begin.c dwarf_begin_elf.c dwarf_end.c dwarf_getelf.c \
426 +libdw_la_SOURCES = dwarf_begin.c dwarf_begin_elf.c dwarf_end.c dwarf_getelf.c \
427 dwarf_getpubnames.c dwarf_getabbrev.c dwarf_tag.c \
428 dwarf_error.c dwarf_nextcu.c dwarf_diename.c dwarf_offdie.c \
429 dwarf_attr.c dwarf_formstring.c \
430 @@ -103,50 +101,12 @@ $(srcdir)/known-dwarf.h: $(top_srcdir)/c
434 -libdw_pic_a_SOURCES =
435 -am_libdw_pic_a_OBJECTS = $(libdw_a_SOURCES:.c=.os)
437 -libdw_so_LIBS = ../libebl/libebl_pic.a ../backends/libebl_backends_pic.a \
438 - ../libcpu/libcpu_pic.a libdw_pic.a ../libdwelf/libdwelf_pic.a \
439 - ../libdwfl/libdwfl_pic.a
440 -libdw_so_DEPS = ../lib/libeu.a ../libelf/libelf.so
441 -libdw_so_LDLIBS = $(libdw_so_DEPS) -ldl -lz $(argp_LDADD) $(fts_LIBS) $(obstack_LIBS) $(zip_LIBS) -pthread
442 -libdw.so: $(srcdir)/libdw.map $(libdw_so_LIBS) $(libdw_so_DEPS)
443 - $(AM_V_CCLD)$(LINK) $(dso_LDFLAGS) -o $@ \
444 - -Wl,--soname,$@.$(VERSION),--enable-new-dtags \
445 - -Wl,--version-script,$< \
447 - -Wl,--whole-archive $(libdw_so_LIBS) -Wl,--no-whole-archive \
450 - $(AM_V_at)ln -fs $@ $@.$(VERSION)
452 -install: install-am libdw.so
453 - $(mkinstalldirs) $(DESTDIR)$(libdir)
454 - $(INSTALL_PROGRAM) libdw.so $(DESTDIR)$(libdir)/libdw-$(PACKAGE_VERSION).so
455 - ln -fs libdw-$(PACKAGE_VERSION).so $(DESTDIR)$(libdir)/libdw.so.$(VERSION)
456 - ln -fs libdw.so.$(VERSION) $(DESTDIR)$(libdir)/libdw.so
458 -uninstall: uninstall-am
459 - rm -f $(DESTDIR)$(libdir)/libdw-$(PACKAGE_VERSION).so
460 - rm -f $(DESTDIR)$(libdir)/libdw.so.$(VERSION)
461 - rm -f $(DESTDIR)$(libdir)/libdw.so
462 - rmdir --ignore-fail-on-non-empty $(DESTDIR)$(includedir)/elfutils
464 -libdwfl_objects = $(shell $(AR) t ../libdwfl/libdwfl.a)
465 -libdw_a_LIBADD = $(addprefix ../libdwfl/,$(libdwfl_objects))
467 -libdwelf_objects = $(shell $(AR) t ../libdwelf/libdwelf.a)
468 -libdw_a_LIBADD += $(addprefix ../libdwelf/,$(libdwelf_objects))
470 -libebl_objects = $(shell $(AR) t ../libebl/libebl.a)
471 -libdw_a_LIBADD += $(addprefix ../libebl/,$(libebl_objects))
473 -backends_objects = $(shell $(AR) t ../backends/libebl_backends.a)
474 -libdw_a_LIBADD += $(addprefix ../backends/,$(backends_objects))
476 -libcpu_objects = $(shell $(AR) t ../libcpu/libcpu.a)
477 -libdw_a_LIBADD += $(addprefix ../libcpu/,$(libcpu_objects))
479 + ../libdwfl/libdwfl.la \
480 + ../libdwelf/libdwelf.la \
481 + ../libebl/libebl.la \
482 + ../backends/libebl_backends.la \
483 + ../libcpu/libcpu.la
485 noinst_HEADERS = libdwP.h memory-access.h dwarf_abbrev_hash.h \
486 dwarf_sig8_hash.h cfi.h encoded-value.h
487 --- a/libasm/Makefile.am
488 +++ b/libasm/Makefile.am
489 @@ -32,12 +32,10 @@ AM_CPPFLAGS += -I$(top_srcdir)/libelf -I
493 -lib_LIBRARIES = libasm.a
494 -noinst_LIBRARIES = libasm_pic.a
495 -noinst_DATA = $(noinst_LIBRARIES:_pic.a=.so)
496 +lib_LTLIBRARIES = libasm.la
497 pkginclude_HEADERS = libasm.h
499 -libasm_a_SOURCES = asm_begin.c asm_abort.c asm_end.c asm_error.c \
500 +libasm_la_SOURCES = asm_begin.c asm_abort.c asm_end.c asm_error.c \
501 asm_getelf.c asm_newscn.c asm_newscn_ingrp.c \
502 asm_newsubscn.c asm_newsym.c asm_newcomsym.c \
504 @@ -51,38 +49,6 @@ libasm_a_SOURCES = asm_begin.c asm_abort
505 disasm_begin.c disasm_cb.c disasm_end.c disasm_str.c \
508 -libasm_pic_a_SOURCES =
509 -am_libasm_pic_a_OBJECTS = $(libasm_a_SOURCES:.c=.os)
511 -libasm_so_DEPS = ../lib/libeu.a ../libebl/libebl_pic.a ../libelf/libelf.so ../libdw/libdw.so
512 -libasm_so_LDLIBS = $(libasm_so_DEPS)
514 -libasm_so_LDLIBS += -lpthread
517 -libasm_so_LIBS = libasm_pic.a
518 -libasm.so: $(srcdir)/libasm.map $(libasm_so_LIBS) $(libasm_so_DEPS)
519 - $(AM_V_CCLD)$(LINK) $(dso_LDFLAGS) -o $@ \
520 - -Wl,--soname,$@.$(VERSION) \
521 - -Wl,--version-script,$< \
523 - -Wl,--whole-archive $(libasm_so_LIBS) -Wl,--no-whole-archive \
524 - $(libasm_so_LDLIBS)
526 - $(AM_V_at)ln -fs $@ $@.$(VERSION)
528 -install: install-am libasm.so
529 - $(mkinstalldirs) $(DESTDIR)$(libdir)
530 - $(INSTALL_PROGRAM) libasm.so $(DESTDIR)$(libdir)/libasm-$(PACKAGE_VERSION).so
531 - ln -fs libasm-$(PACKAGE_VERSION).so $(DESTDIR)$(libdir)/libasm.so.$(VERSION)
532 - ln -fs libasm.so.$(VERSION) $(DESTDIR)$(libdir)/libasm.so
534 -uninstall: uninstall-am
535 - rm -f $(DESTDIR)$(libdir)/libasm-$(PACKAGE_VERSION).so
536 - rm -f $(DESTDIR)$(libdir)/libasm.so.$(VERSION)
537 - rm -f $(DESTDIR)$(libdir)/libasm.so
538 - rmdir --ignore-fail-on-non-empty $(DESTDIR)$(includedir)/elfutils
540 noinst_HEADERS = libasmP.h symbolhash.h
541 EXTRA_DIST = libasm.map
543 --- a/libdwfl/Makefile.am
544 +++ b/libdwfl/Makefile.am
545 @@ -34,13 +34,11 @@ AM_CPPFLAGS += -I$(srcdir) -I$(srcdir)/.
546 -I$(srcdir)/../libdw -I$(srcdir)/../libdwelf -I$(builddir)/../debuginfod
549 -noinst_LIBRARIES = libdwfl.a
550 -noinst_LIBRARIES += libdwfl_pic.a
551 +noinst_LTLIBRARIES = libdwfl.la
553 pkginclude_HEADERS = libdwfl.h
556 -libdwfl_a_SOURCES = dwfl_begin.c dwfl_end.c dwfl_error.c dwfl_version.c \
557 +libdwfl_la_SOURCES = dwfl_begin.c dwfl_end.c dwfl_error.c dwfl_version.c \
558 dwfl_module.c dwfl_report_elf.c relocate.c \
559 dwfl_module_build_id.c dwfl_module_report_build_id.c \
560 derelocate.c offline.c segment.c \
561 @@ -73,24 +71,14 @@ libdwfl_a_SOURCES = dwfl_begin.c dwfl_en
562 gzip.c debuginfod-client.c
565 -libdwfl_a_SOURCES += bzip2.c
566 +libdwfl_la_SOURCES += bzip2.c
569 -libdwfl_a_SOURCES += lzma.c
570 +libdwfl_la_SOURCES += lzma.c
573 -libdwfl_a_SOURCES += zstd.c
574 +libdwfl_la_SOURCES += zstd.c
578 -libdw = ../libdw/libdw.so
579 -libelf = ../libelf/libelf.so
580 -libebl = ../libebl/libebl.a
581 -libeu = ../lib/libeu.a
583 -libdwfl_pic_a_SOURCES =
584 -am_libdwfl_pic_a_OBJECTS = $(libdwfl_a_SOURCES:.c=.os)
586 noinst_HEADERS = libdwflP.h
588 -CLEANFILES += $(am_libdwfl_pic_a_OBJECTS)
589 --- a/backends/Makefile.am
590 +++ b/backends/Makefile.am
591 @@ -34,7 +34,7 @@ endif
592 AM_CPPFLAGS += -I$(top_srcdir)/libebl -I$(top_srcdir)/libasm \
593 -I$(top_srcdir)/libelf -I$(top_srcdir)/libdw
595 -noinst_LIBRARIES = libebl_backends.a libebl_backends_pic.a
596 +noinst_LTLIBRARIES = libebl_backends.la
598 modules = i386 sh x86_64 ia64 alpha arm aarch64 sparc ppc ppc64 s390 \
599 m68k bpf riscv csky loongarch arc
600 @@ -100,17 +100,13 @@ loongarch_SRCS = loongarch_init.c loonga
602 arc_SRCS = arc_init.c arc_symbol.c
604 -libebl_backends_a_SOURCES = $(i386_SRCS) $(sh_SRCS) $(x86_64_SRCS) \
605 +libebl_backends_la_SOURCES = $(i386_SRCS) $(sh_SRCS) $(x86_64_SRCS) \
606 $(ia64_SRCS) $(alpha_SRCS) $(arm_SRCS) \
607 $(aarch64_SRCS) $(sparc_SRCS) $(ppc_SRCS) \
608 $(ppc64_SRCS) $(s390_SRCS) \
609 $(m68k_SRCS) $(bpf_SRCS) $(riscv_SRCS) $(csky_SRCS) \
610 $(loongarch_SRCS) $(arc_SRCS)
612 -libebl_backends_pic_a_SOURCES =
613 -am_libebl_backends_pic_a_OBJECTS = $(libebl_backends_a_SOURCES:.c=.os)
615 noinst_HEADERS = libebl_CPU.h common-reloc.c linux-core-note.c x86_corenote.c
616 EXTRA_DIST = $(modules:=_reloc.def)
618 -MOSTLYCLEANFILES = $(am_libebl_backends_pic_a_OBJECTS)
619 --- a/libdwelf/Makefile.am
620 +++ b/libdwelf/Makefile.am
621 @@ -34,24 +34,12 @@ AM_CPPFLAGS += -I$(srcdir)/../libelf -I$
622 -I$(srcdir)/../libdwfl -I$(srcdir)/../libebl
625 -noinst_LIBRARIES = libdwelf.a libdwelf_pic.a
626 +noinst_LTLIBRARIES = libdwelf.la
628 pkginclude_HEADERS = libdwelf.h
629 noinst_HEADERS = libdwelfP.h
631 -libdwelf_a_SOURCES = dwelf_elf_gnu_debuglink.c dwelf_dwarf_gnu_debugaltlink.c \
632 +libdwelf_la_SOURCES = dwelf_elf_gnu_debuglink.c dwelf_dwarf_gnu_debugaltlink.c \
633 dwelf_elf_gnu_build_id.c dwelf_scn_gnu_compressed_size.c \
634 dwelf_strtab.c dwelf_elf_begin.c \
635 dwelf_elf_e_machine_string.c
639 -libdw = ../libdw/libdw.so
640 -libelf = ../libelf/libelf.so
641 -libebl = ../libebl/libebl.a
642 -libeu = ../lib/libeu.a
644 -libdwelf_pic_a_SOURCES =
645 -am_libdwelf_pic_a_OBJECTS = $(libdwelf_a_SOURCES:.c=.os)
647 -CLEANFILES += $(am_libdwelf_pic_a_OBJECTS)
648 --- a/libebl/Makefile.am
649 +++ b/libebl/Makefile.am
650 @@ -34,9 +34,9 @@ endif
651 AM_CPPFLAGS += -I$(srcdir)/../libelf -I$(srcdir)/../libdw -I$(srcdir)/../libasm
654 -noinst_LIBRARIES = libebl.a libebl_pic.a
655 +noinst_LTLIBRARIES = libebl.la
657 -libebl_a_SOURCES = eblopenbackend.c eblclosebackend.c eblreloctypename.c \
658 +libebl_la_SOURCES = eblopenbackend.c eblclosebackend.c eblreloctypename.c \
659 eblsegmenttypename.c eblsectiontypename.c \
660 eblmachineflagname.c eblsymboltypename.c \
661 ebldynamictagname.c eblsectionname.c \
662 @@ -56,9 +56,4 @@ libebl_a_SOURCES = eblopenbackend.c eblc
663 eblresolvesym.c eblcheckreloctargettype.c \
664 ebl_data_marker_symbol.c
666 -libebl_pic_a_SOURCES =
667 -am_libebl_pic_a_OBJECTS = $(libebl_a_SOURCES:.c=.os)
669 noinst_HEADERS = libebl.h libeblP.h ebl-hooks.h
671 -MOSTLYCLEANFILES = $(am_libebl_pic_a_OBJECTS)
672 --- a/debuginfod/Makefile.am
673 +++ b/debuginfod/Makefile.am
674 @@ -40,23 +40,12 @@ AM_CPPFLAGS += -I$(srcdir) -I$(srcdir)/.
676 program_transform_name = s,x,x,
679 -libasm = ../libasm/libasm.a
680 -libdw = ../libdw/libdw.a -lz $(zip_LIBS) $(libelf) $(libebl) -ldl -lpthread
681 -libelf = ../libelf/libelf.a -lz
682 -if DUMMY_LIBDEBUGINFOD
683 -libdebuginfod = ./libdebuginfod.a
685 -libdebuginfod = ./libdebuginfod.a -lpthread $(libcurl_LIBS)
688 -libasm = ../libasm/libasm.so
689 -libdw = ../libdw/libdw.so
690 -libelf = ../libelf/libelf.so
691 -libdebuginfod = ./libdebuginfod.so
693 -libebl = ../libebl/libebl.a
694 -libeu = ../lib/libeu.a
695 +libasm = ../libasm/libasm.la
696 +libdw = ../libdw/libdw.la -lz $(zip_LIBS) $(libelf) $(libebl) -ldl -lpthread
697 +libelf = ../libelf/libelf.la
698 +libdebuginfod = ./libdebuginfod.la
699 +libebl = ../libebl/libebl.la
700 +libeu = ../lib/libeu.la
702 AM_LDFLAGS = -Wl,-rpath-link,../libelf:../libdw:.
704 @@ -76,14 +65,10 @@ debuginfod_find_SOURCES = debuginfod-fin
705 debuginfod_find_LDADD = $(libdw) $(libelf) $(libeu) $(libdebuginfod) $(argp_LDADD) $(fts_LIBS)
708 -noinst_LIBRARIES = libdebuginfod.a
709 -noinst_LIBRARIES += libdebuginfod_pic.a
710 +libdebuginfod_la_SOURCES = debuginfod-client.c
711 +noinst_LTLIBRARIES = libdebuginfod.la
714 -libdebuginfod_a_SOURCES = debuginfod-client.c
715 -libdebuginfod_pic_a_SOURCES = debuginfod-client.c
716 -am_libdebuginfod_pic_a_OBJECTS = $(libdebuginfod_a_SOURCES:.c=.os)
718 if DUMMY_LIBDEBUGINFOD
719 AM_CPPFLAGS += -Wno-unused-parameter
721 @@ -92,42 +77,7 @@ if LIBDEBUGINFOD
722 pkginclude_HEADERS = debuginfod.h
726 -libdebuginfod_so_LIBS = libdebuginfod_pic.a
727 -if DUMMY_LIBDEBUGINFOD
728 -libdebuginfod_so_LDLIBS =
730 -libdebuginfod_so_LDLIBS = -lpthread $(libcurl_LIBS) $(fts_LIBS) $(libelf)
732 -$(LIBDEBUGINFOD_SONAME): $(srcdir)/libdebuginfod.map $(libdebuginfod_so_LIBS)
733 - $(AM_V_CCLD)$(LINK) $(dso_LDFLAGS) -o $@ \
734 - -Wl,--soname,$(LIBDEBUGINFOD_SONAME) \
735 - -Wl,--version-script,$< \
737 - -Wl,--whole-archive $(libdebuginfod_so_LIBS) -Wl,--no-whole-archive \
738 - $(libdebuginfod_so_LDLIBS)
741 -libdebuginfod.so: $(LIBDEBUGINFOD_SONAME)
744 -install: install-am libdebuginfod.so
745 - $(mkinstalldirs) $(DESTDIR)$(libdir)
746 - $(INSTALL_PROGRAM) $(LIBDEBUGINFOD_SONAME) \
747 - $(DESTDIR)$(libdir)/libdebuginfod-$(PACKAGE_VERSION).so
748 - ln -fs libdebuginfod-$(PACKAGE_VERSION).so $(DESTDIR)$(libdir)/$(LIBDEBUGINFOD_SONAME)
749 - ln -fs libdebuginfod-$(PACKAGE_VERSION).so $(DESTDIR)$(libdir)/libdebuginfod.so
751 -uninstall: uninstall-am
752 - rm -f $(DESTDIR)$(libdir)/libdebuginfod-$(PACKAGE_VERSION).so
753 - rm -f $(DESTDIR)$(libdir)/$(LIBDEBUGINFOD_SONAME)
754 - rm -f $(DESTDIR)$(libdir)/libdebuginfod.so
755 - rmdir --ignore-fail-on-non-empty $(DESTDIR)$(includedir)/elfutils
758 EXTRA_DIST = libdebuginfod.map
759 -MOSTLYCLEANFILES = $(am_libdebuginfod_pic_a_OBJECTS) $(LIBDEBUGINFOD_SONAME)
760 -CLEANFILES += $(am_libdebuginfod_pic_a_OBJECTS) libdebuginfod.so
762 # automake std-options override: arrange to pass LD_LIBRARY_PATH
763 installcheck-binPROGRAMS: $(bin_PROGRAMS)
764 --- a/lib/Makefile.am
765 +++ b/lib/Makefile.am
766 @@ -31,9 +31,9 @@ include $(top_srcdir)/config/eu.am
767 AM_CFLAGS += $(fpic_CFLAGS)
768 AM_CPPFLAGS += -I$(srcdir)/../libelf
770 -noinst_LIBRARIES = libeu.a
771 +noinst_LTLIBRARIES = libeu.la
773 -libeu_a_SOURCES = xasprintf.c xstrdup.c xstrndup.c xmalloc.c next_prime.c \
774 +libeu_la_SOURCES = xasprintf.c xstrdup.c xstrndup.c xmalloc.c next_prime.c \
775 crc32.c crc32_file.c \
776 color.c error.c printversion.c
778 --- a/src/Makefile.am
779 +++ b/src/Makefile.am
780 @@ -29,9 +29,9 @@ bin_PROGRAMS = readelf nm size strip elf
781 elfcmp objdump ranlib strings ar unstrip stack elfcompress \
784 -noinst_LIBRARIES = libar.a
785 +noinst_LTLIBRARIES = libar.la
787 -libar_a_SOURCES = arlib.c arlib2.c arlib-argp.c
788 +libar_la_SOURCES = arlib.c arlib2.c arlib-argp.c
790 EXTRA_DIST = arlib.h debugpred.h
792 @@ -39,17 +39,11 @@ bin_SCRIPTS = make-debug-archive
793 EXTRA_DIST += make-debug-archive.in
794 CLEANFILES += make-debug-archive
797 -libasm = ../libasm/libasm.a
798 -libdw = ../libdw/libdw.a -lz $(zip_LIBS) $(libelf) -ldl -lpthread
799 -libelf = ../libelf/libelf.a -lz
801 -libasm = ../libasm/libasm.so
802 -libdw = ../libdw/libdw.so
803 -libelf = ../libelf/libelf.so
805 -libebl = ../libebl/libebl.a ../backends/libebl_backends.a ../libcpu/libcpu.a
806 -libeu = ../lib/libeu.a
807 +libasm = ../libasm/libasm.la
808 +libdw = ../libdw/libdw.la -lz $(zip_LIBS) $(libelf) -ldl -lpthread
809 +libelf = ../libelf/libelf.la
810 +libebl = ../libebl/libebl.la ../backends/libebl_backends.la ../libcpu/libcpu.la
811 +libeu = ../lib/libeu.la
814 demanglelib = -lstdc++
815 @@ -77,9 +71,9 @@ findtextrel_LDADD = $(libdw) $(libelf) $
816 addr2line_LDADD = $(libdw) $(libelf) $(libeu) $(argp_LDADD) $(demanglelib)
817 elfcmp_LDADD = $(libebl) $(libdw) $(libelf) $(libeu) $(argp_LDADD)
818 objdump_LDADD = $(libasm) $(libebl) $(libdw) $(libelf) $(libeu) $(argp_LDADD)
819 -ranlib_LDADD = libar.a $(libelf) $(libeu) $(argp_LDADD) $(obstack_LIBS)
820 +ranlib_LDADD = libar.la $(libelf) $(libeu) $(argp_LDADD) $(obstack_LIBS)
821 strings_LDADD = $(libelf) $(libeu) $(argp_LDADD)
822 -ar_LDADD = libar.a $(libelf) $(libeu) $(argp_LDADD) $(obstack_LIBS)
823 +ar_LDADD = libar.la $(libelf) $(libeu) $(argp_LDADD) $(obstack_LIBS)
824 unstrip_LDADD = $(libebl) $(libelf) $(libdw) $(libeu) $(argp_LDADD)
825 stack_LDADD = $(libebl) $(libelf) $(libdw) $(libeu) $(argp_LDADD) $(demanglelib)
826 elfcompress_LDADD = $(libebl) $(libelf) $(libdw) $(libeu) $(argp_LDADD)
827 --- a/tests/Makefile.am
828 +++ b/tests/Makefile.am
829 @@ -662,17 +662,11 @@ installcheck-local:
830 TESTS_ENVIRONMENT="$(installed_TESTS_ENVIRONMENT)" \
831 LOG_COMPILER="$(installed_LOG_COMPILER)" check-TESTS
834 -libdw = ../libdw/libdw.a -lz $(zip_LIBS) $(libelf) $(libebl) -ldl -lpthread
835 -libelf = ../libelf/libelf.a -lz
836 -libasm = ../libasm/libasm.a
838 -libdw = ../libdw/libdw.so
839 -libelf = ../libelf/libelf.so
840 -libasm = ../libasm/libasm.so
842 -libebl = ../libebl/libebl.a ../backends/libebl_backends.a ../libcpu/libcpu.a
843 -libeu = ../lib/libeu.a
844 +libdw = ../libdw/libdw.la -lz $(zip_LIBS) $(libelf) $(libebl) -ldl -lpthread
845 +libelf = ../libelf/libelf.la
846 +libasm = ../libasm/libasm.la
847 +libebl = ../libebl/libebl.la ../backends/libebl_backends.la ../libcpu/libcpu.la
848 +libeu = ../lib/libeu.la
850 arextract_LDADD = $(libelf)
851 arsymtest_LDADD = $(libelf)
852 --- a/libcpu/Makefile.am
853 +++ b/libcpu/Makefile.am
854 @@ -38,19 +38,16 @@ LEXCOMPILE = $(LEX) $(LFLAGS) $(AM_LFLAG
855 LEX_OUTPUT_ROOT = lex.$(<F:lex.l=)
856 AM_YFLAGS = -p$(<F:parse.y=)
858 -noinst_LIBRARIES = libcpu.a libcpu_pic.a
859 +noinst_LTLIBRARIES = libcpu.la
861 noinst_HEADERS = i386_dis.h i386_mne.h x86_64_dis.h
863 -libcpu_a_SOURCES = i386_disasm.c x86_64_disasm.c bpf_disasm.c riscv_disasm.c
865 -libcpu_pic_a_SOURCES =
866 -am_libcpu_pic_a_OBJECTS = $(libcpu_a_SOURCES:.c=.os)
867 +libcpu_la_SOURCES = i386_disasm.c x86_64_disasm.c bpf_disasm.c riscv_disasm.c
869 i386_gendis_SOURCES = i386_gendis.c i386_lex.l i386_parse.y
871 -i386_disasm.o: i386.mnemonics $(srcdir)/i386_dis.h
872 -x86_64_disasm.o: x86_64.mnemonics $(srcdir)/x86_64_dis.h
873 +$(libcpu_la_OBJECTS): i386.mnemonics $(srcdir)/i386_dis.h
874 +$(libcpu_la_OBJECTS): x86_64.mnemonics $(srcdir)/x86_64_dis.h
876 %_defs: $(srcdir)/defs/i386
877 $(AM_V_GEN)m4 -D$* -DDISASSEMBLER $< > $@T
878 @@ -87,20 +84,15 @@ endif
880 i386_lex_no_Werror = yes
882 -libeu = ../lib/libeu.a
883 +libeu = ../lib/libeu.la
885 i386_lex_CFLAGS = -Wno-unused-label -Wno-unused-function -Wno-sign-compare \
886 -Wno-implicit-fallthrough
887 -i386_parse.o: i386_parse.c i386.mnemonics
888 -i386_lex.o: i386_parse.h
889 i386_gendis_LDADD = $(libeu) -lm $(obstack_LIBS)
891 -i386_parse.h: i386_parse.c ;
893 bpf_disasm_CFLAGS = -Wno-format-nonliteral
895 EXTRA_DIST = defs/i386
897 -MOSTLYCLEANFILES = $(am_libcpu_pic_a_OBJECTS)
898 CLEANFILES += $(foreach P,i386 x86_64,$P_defs $P.mnemonics)
899 MAINTAINERCLEANFILES = $(foreach P,i386 x86_64, $P_dis.h)
900 --- a/config/libelf.pc.in
901 +++ b/config/libelf.pc.in
902 @@ -8,7 +8,7 @@ Description: elfutils libelf library to
904 URL: http://elfutils.org/
906 -Libs: -L${libdir} -lelf
907 +Libs: -L${libdir} -lelf -lz
908 Cflags: -I${includedir}
910 Requires.private: zlib @LIBZSTD@