public inbox for elfutils@sourceware.org
 help / color / mirror / Atom feed
From: Omar Sandoval <osandov@osandov.com>
To: elfutils-devel@sourceware.org
Subject: [PATCH 5/5] libdw: export libebl symbols
Date: Sat, 06 Jul 2019 00:35:00 -0000	[thread overview]
Message-ID: <80970424804952094aaee7a0cc3279c4b8835661.1562372641.git.osandov@fb.com> (raw)
In-Reply-To: <cover.1562372641.git.osandov@fb.com>

From: Omar Sandoval <osandov@fb.com>

The main downside of the previous change to build in all libebl backend
modules statically is that the total installed size of elfutils
increased (from 2.1 MB to 3.5 MB in my case). This is because we have to
statically link libebl and its backends into every binary. Instead,
since libebl is already linked into libdw.so, we can simply export the
libebl symbols in libdw.so for the binaries to use. This shrinks the
total size to 1.7 MB, which is smaller than where we started.

This doesn't change the status of libebl: it is still considered
internal and the API/ABI are still subject to change.

Signed-off-by: Omar Sandoval <osandov@fb.com>
---
 libdw/ChangeLog |  1 +
 libdw/libdw.map | 60 ++++++++++++++++++++++++++++++++++++++++++++++++-
 src/ChangeLog   | 10 +++++++++
 src/Makefile.am | 19 ++++++++--------
 4 files changed, 79 insertions(+), 11 deletions(-)

diff --git a/libdw/ChangeLog b/libdw/ChangeLog
index 4e088688..84e03699 100644
--- a/libdw/ChangeLog
+++ b/libdw/ChangeLog
@@ -5,6 +5,7 @@
 	(libdw_so_LDLIBS): Remove -ldl.
 	(libdw.so): Remove -rpath.
 	(libdw_a_LIBADD): Add libebl, libebl_backends, and libcpu objects.
+	* libdw.map (ELFUTILS_0.177): New section. Add libebl symbols.
 
 2019-05-16  Mark Wielaard  <mark@klomp.org>
 
diff --git a/libdw/libdw.map b/libdw/libdw.map
index 55482d58..c9f69d32 100644
--- a/libdw/libdw.map
+++ b/libdw/libdw.map
@@ -360,4 +360,62 @@ ELFUTILS_0.173 {
 ELFUTILS_0.175 {
   global:
     dwelf_elf_begin;
-} ELFUTILS_0.173;
\ No newline at end of file
+} ELFUTILS_0.173;
+
+ELFUITLS_0.177 {
+  global:
+    ebl_openbackend;
+    ebl_openbackend_machine;
+    ebl_openbackend_emulation;
+    ebl_closebackend;
+    ebl_get_elfmachine;
+    ebl_get_elfclass;
+    ebl_get_elfdata;
+    ebl_backend_name;
+    ebl_reloc_type_name;
+    ebl_reloc_type_check;
+    ebl_reloc_valid_use;
+    ebl_reloc_simple_type;
+    ebl_gotpc_reloc_check;
+    ebl_segment_type_name;
+    ebl_section_type_name;
+    ebl_section_name;
+    ebl_machine_flag_name;
+    ebl_machine_flag_check;
+    ebl_machine_section_flag_check;
+    ebl_check_special_section;
+    ebl_symbol_type_name;
+    ebl_symbol_binding_name;
+    ebl_dynamic_tag_name;
+    ebl_dynamic_tag_check;
+    ebl_check_special_symbol;
+    ebl_data_marker_symbol;
+    ebl_check_st_other_bits;
+    ebl_osabi_name;
+    ebl_core_note_type_name;
+    ebl_object_note_type_name;
+    ebl_object_note;
+    ebl_check_object_attribute;
+    ebl_check_reloc_target_type;
+    ebl_debugscn_p;
+    ebl_copy_reloc_p;
+    ebl_none_reloc_p;
+    ebl_relative_reloc_p;
+    ebl_section_strip_p;
+    ebl_bss_plt_p;
+    ebl_sysvhash_entrysize;
+    ebl_return_value_location;
+    ebl_register_info;
+    ebl_syscall_abi;
+    ebl_abi_cfi;
+    ebl_core_note;
+    ebl_auxv_info;
+    ebl_set_initial_registers_tid;
+    ebl_frame_nregs;
+    ebl_ra_offset;
+    ebl_func_addr_mask;
+    ebl_dwarf_to_regno;
+    ebl_normalize_pc;
+    ebl_unwind;
+    ebl_resolve_sym_value;
+} ELFUTILS_0.175;
diff --git a/src/ChangeLog b/src/ChangeLog
index a8b1e267..2ce39db0 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,9 +1,19 @@
 2019-07-05  Omar Sandoval  <osandov@fb.com>
 
 	* Makefile.am: Remove -ldl.
+	Remove libebl definition.
+	(readelf_LDADD): Remove $(libebl).
+	(nm_LDADD): Remove $(libebl).
+	(strip_LDADD): Remove $(libebl).
 	(elflint_LDADD): Add $(libdw).
+	Remove $(libebl).
 	(elfcmp_LDADD): Add $(libdw).
+	Remove $(libebl).
 	(objdump_LDADD): Add $(libdw).
+	Remove $(libebl).
+	(unstrip_LDADD): Remove $(libebl).
+	(stack_LDADD): Remove $(libebl).
+	(elfcompress_LDADD): Remove $(libebl).
 
 2019-06-25  Mark Wielaard  <mark@klomp.org>
 
diff --git a/src/Makefile.am b/src/Makefile.am
index 42970da3..d219e8fe 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -47,7 +47,6 @@ libasm = ../libasm/libasm.so
 libdw = ../libdw/libdw.so
 libelf = ../libelf/libelf.so
 endif
-libebl = ../libebl/libebl.a ../backends/libebl_backends.a ../libcpu/libcpu.a
 libeu = ../lib/libeu.a
 
 if DEMANGLE
@@ -67,22 +66,22 @@ ranlib_no_Wstack_usage = yes
 ar_no_Wstack_usage = yes
 unstrip_no_Wstack_usage = yes
 
-readelf_LDADD = $(libdw) $(libebl) $(libelf) $(libeu) $(argp_LDADD)
-nm_LDADD = $(libdw) $(libebl) $(libelf) $(libeu) $(argp_LDADD) \
+readelf_LDADD = $(libdw) $(libelf) $(libeu) $(argp_LDADD)
+nm_LDADD = $(libdw) $(libelf) $(libeu) $(argp_LDADD) \
 	   $(demanglelib)
 size_LDADD = $(libelf) $(libeu) $(argp_LDADD)
-strip_LDADD = $(libebl) $(libelf) $(libdw) $(libeu) $(argp_LDADD)
-elflint_LDADD  = $(libebl) $(libdw) $(libelf) $(libeu) $(argp_LDADD)
+strip_LDADD = $(libelf) $(libdw) $(libeu) $(argp_LDADD)
+elflint_LDADD  = $(libdw) $(libelf) $(libeu) $(argp_LDADD)
 findtextrel_LDADD = $(libdw) $(libelf) $(libeu) $(argp_LDADD)
 addr2line_LDADD = $(libdw) $(libelf) $(libeu) $(argp_LDADD) $(demanglelib)
-elfcmp_LDADD = $(libebl) $(libdw) $(libelf) $(libeu) $(argp_LDADD)
-objdump_LDADD  = $(libasm) $(libebl) $(libdw) $(libelf) $(libeu) $(argp_LDADD)
+elfcmp_LDADD = $(libdw) $(libelf) $(libeu) $(argp_LDADD)
+objdump_LDADD  = $(libasm) $(libdw) $(libelf) $(libeu) $(argp_LDADD)
 ranlib_LDADD = libar.a $(libelf) $(libeu) $(argp_LDADD)
 strings_LDADD = $(libelf) $(libeu) $(argp_LDADD)
 ar_LDADD = libar.a $(libelf) $(libeu) $(argp_LDADD)
-unstrip_LDADD = $(libebl) $(libelf) $(libdw) $(libeu) $(argp_LDADD)
-stack_LDADD = $(libebl) $(libelf) $(libdw) $(libeu) $(argp_LDADD) $(demanglelib)
-elfcompress_LDADD = $(libebl) $(libelf) $(libdw) $(libeu) $(argp_LDADD)
+unstrip_LDADD = $(libelf) $(libdw) $(libeu) $(argp_LDADD)
+stack_LDADD = $(libelf) $(libdw) $(libeu) $(argp_LDADD) $(demanglelib)
+elfcompress_LDADD = $(libelf) $(libdw) $(libeu) $(argp_LDADD)
 
 installcheck-binPROGRAMS: $(bin_PROGRAMS)
 	bad=0; pid=$$$$; list="$(bin_PROGRAMS)"; for p in $$list; do \
-- 
2.22.0

  reply	other threads:[~2019-07-06  0:35 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-06  0:35 [PATCH 0/5] elfutils: don't use dlopen() for libebl modules Omar Sandoval
2019-07-06  0:35 ` Omar Sandoval [this message]
2019-07-08 21:14   ` [PATCH 5/5] libdw: export libebl symbols Mark Wielaard
2019-07-06  0:35 ` [PATCH 4/5] Don't use dlopen() for libebl modules Omar Sandoval
2019-07-06  0:35 ` [PATCH 2/5] libcpu: merge libcpu_{i386,x86_64,bpf} into one library Omar Sandoval
2019-07-06  0:35 ` [PATCH 1/5] libebl: remove unnecessary variable in Makefile.am Omar Sandoval
2019-07-06  0:35 ` [PATCH 3/5] Add PIC and non-PIC variants of libcpu and libebl Omar Sandoval

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=80970424804952094aaee7a0cc3279c4b8835661.1562372641.git.osandov@fb.com \
    --to=osandov@osandov.com \
    --cc=elfutils-devel@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).