libelf = ../libelf/libelf.so
libdw = ../libdw/libdw.so
+ libeu = ../lib/libeu.a
- ppc64_resolve_sym.c \
+# The following is minimal set of backends that we link with libdw to
+# avoid dlopen. Note repeats files below because some backends reuse
+# each others files.
+static_SRCS = i386_init.c i386_symbol.c i386_corenote.c i386_cfi.c \
+ i386_retval.c i386_regs.c i386_auxv.c i386_syscall.c \
+ i386_initreg.c i386_unwind.c \
+ x86_64_init.c x86_64_symbol.c x86_64_corenote.c x86_64_cfi.c \
+ x86_64_retval.c x86_64_regs.c x86_64_syscall.c \
+ x86_64_initreg.c x86_64_unwind.c x32_corenote.c \
+ ia64_init.c ia64_symbol.c ia64_regs.c ia64_retval.c \
+ aarch64_init.c aarch64_regs.c aarch64_symbol.c \
+ aarch64_corenote.c aarch64_retval.c aarch64_cfi.c \
+ aarch64_initreg.c aarch64_unwind.c \
+ ppc_init.c ppc_symbol.c ppc_retval.c ppc_regs.c \
+ ppc_corenote.c ppc_auxv.c ppc_attrs.c ppc_syscall.c \
+ ppc_cfi.c ppc_initreg.c \
+ ppc64_init.c ppc64_symbol.c ppc64_retval.c ppc64_corenote.c \
++ ppc64_resolve_sym.c ppc64_unwind.c \
+ s390_init.c s390_symbol.c s390_regs.c s390_retval.c \
+ s390_corenote.c s390x_corenote.c s390_cfi.c s390_initreg.c \
+ s390_unwind.c bpf_init.c bpf_regs.c
+
+libebl_static_pic_a_SOURCES = $(static_SRCS)
+am_libebl_static_pic_a_OBJECTS = $(static_SRCS:.c=.os)
+
i386_SRCS = i386_init.c i386_symbol.c i386_corenote.c i386_cfi.c \
i386_retval.c i386_regs.c i386_auxv.c i386_syscall.c \
i386_initreg.c i386_unwind.c
noinst_LIBRARIES += libcpu_bpf.a
libcpu_bpf_a_SOURCES = bpf_disasm.c
libcpu_bpf_a_CFLAGS = $(AM_CFLAGS) -Wno-format-nonliteral
- endif
+libcpu_static_pic_a_SOURCES += $(libcpu_bpf_a_SOURCES)
+bpf_disasm_CFLAGS = -fPIC -Wno-format-nonliteral
%_defs: $(srcdir)/defs/i386
$(AM_V_GEN)m4 -D$* -DDISASSEMBLER $< > $@T
dwarf_aggregate_size.c dwarf_getlocation_implicit_pointer.c \
dwarf_getlocation_die.c dwarf_getlocation_attr.c \
dwarf_getalt.c dwarf_setalt.c dwarf_cu_getdwarf.c \
- dwarf_cu_die.c dwarf_peel_type.c
+ dwarf_cu_die.c dwarf_peel_type.c dwarf_default_lower_bound.c
- dwarf_bytesize.c dwarf_bitsize.c dwarf_peel_type.c
+# Minimal library with symbols needed by those libebl backends that we
+# ship statically. This is so that e.g. strip doesn't end up bringing
+# in the whole of libdw, and depending on libbz2, liblzma, etc.
+libdw_static_pic_a_SOURCES = libdw_form.c dwarf_child.c dwarf_attr.c \
+ dwarf_attr_integrate.c dwarf_formref_die.c dwarf_error.c \
+ dwarf_tag.c dwarf_formref.c \
+ dwarf_abbrev_hash.c dwarf_sig8_hash.c \
+ dwarf_formudata.c libdw_findcu.c dwarf_offdie.c \
+ dwarf_getabbrev.c dwarf_nextcu.c libdw_alloc.c \
+ dwarf_hasattr_integrate.c dwarf_hasattr.c \
+ dwarf_aggregate_size.c dwarf_siblingof.c dwarf_formsdata.c \
+ dwarf_srclang.c dwarf_formflag.c dwarf_diecu.c \
++ dwarf_bytesize.c dwarf_bitsize.c dwarf_peel_type.c \
++ dwarf_default_lower_bound.c
+
if MAINTAINER_MODE
BUILT_SOURCES = $(srcdir)/known-dwarf.h
MAINTAINERCLEANFILES = $(srcdir)/known-dwarf.h
libdw_pic_a_SOURCES =
am_libdw_pic_a_OBJECTS = $(libdw_a_SOURCES:.c=.os)
+am_libdw_static_pic_a_OBJECTS = $(libdw_static_pic_a_SOURCES:.c=.os)
- libdw_so_SOURCES =
- libdw.so$(EXEEXT): $(srcdir)/libdw.map libdw_pic.a ../libdwelf/libdwelf_pic.a \
+ libdw_so_LIBS = libdw_pic.a ../libdwelf/libdwelf_pic.a \
- ../libdwfl/libdwfl_pic.a ../libebl/libebl.a
+ ../libdwfl/libdwfl_pic.a ../libebl/libebl.a \
+ ../backends/libebl_static_pic.a \
- ../libcpu/libcpu_static_pic.a \
- ../libelf/libelf.so
++ ../libcpu/libcpu_static_pic.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_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)
eblsysvhashentrysize.c eblauxvinfo.c eblcheckobjattr.c \
ebl_check_special_section.c ebl_syscall_abi.c eblabicfi.c \
eblstother.c eblinitreg.c ebldwarftoregno.c eblnormalizepc.c \
- eblunwind.c eblresolvesym.c eblcheckreloctargettype.c
+ eblunwind.c eblresolvesym.c eblcheckreloctargettype.c \
+ ebl_data_marker_symbol.c
+libebl_a_CFLAGS = -fvisibility=hidden $(AM_CFLAGS)
libebl_a_SOURCES = $(gen_SOURCES)
noinst_HEADERS = libeblP.h ebl-hooks.h
newscn run-strip-test.sh run-strip-test2.sh \
run-strip-test3.sh run-strip-test4.sh run-strip-test5.sh \
run-strip-test6.sh run-strip-test7.sh run-strip-test8.sh \
- run-strip-test9.sh run-strip-test10.sh run-strip-test11.sh \
+ run-strip-test9.sh run-strip-test10.sh \
+ run-strip-nothing.sh run-strip-g.sh \
run-strip-groups.sh run-strip-reloc.sh run-strip-strmerge.sh \
- run-strip-nobitsalign.sh \
+ run-strip-nobitsalign.sh run-strip-remove-keep.sh \
run-unstrip-test.sh run-unstrip-test2.sh run-unstrip-test3.sh \
run-unstrip-test4.sh run-unstrip-M.sh run-elfstrmerge-test.sh \
run-ecp-test.sh run-ecp-test2.sh run-alldts.sh \
--- /dev/null
-echo $status
-if test $status -ne 0; then
- echo no symtab found in strip.out
- exit 1
-fi
-
-status=0
-testrun ${abs_top_builddir}/src/readelf -S debug.out > readelf.out
-grep SYMTAB readelf.out || status=$?
-echo $status
-if test $status -ne 1; then
- echo symtab found in debug.out
- exit 1
-fi
-
-# arm (with data marker in .debug_frame). See tests/run-addrcfi.sh
-testfiles testfilearm
-
-echo arm strip -g to file with debug file
-testrun ${abs_top_builddir}/src/strip -g -o strip.out -f debug.out testfilearm ||
- { echo "*** failed to strip -g -o strip.out -f debug.out a.out"; exit -1; }
-
-status=0
-testrun ${abs_top_builddir}/src/readelf -S strip.out > readelf.out
-grep SYMTAB readelf.out || status=$?
+ #! /bin/sh
+ # Copyright (C) 2017 Red Hat, Inc.
+ # This file is part of elfutils.
+ #
+ # This file is free software; you can redistribute it and/or modify
+ # it under the terms of the GNU General Public License as published by
+ # the Free Software Foundation; either version 3 of the License, or
+ # (at your option) any later version.
+ #
+ # elfutils is distributed in the hope that it will be useful, but
+ # WITHOUT ANY WARRANTY; without even the implied warranty of
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ # GNU General Public License for more details.
+ #
+ # You should have received a copy of the GNU General Public License
+ # along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+ . $srcdir/test-subr.sh
+
+ # When stripping just the debug sections/symbols we keep the symtab
+ # in the main ELF file. There should be no symbols pointing into the
+ # debug sections and so there should not be a copy in the debug file
+ # except for a NOBITS one.
+
+ tempfiles a.out strip.out debug.out readelf.out
+
+ echo Create debug a.out.
+ echo "int main() { return 1; }" | gcc -g -xc -
+
+ echo strip -g to file with debug file
+ testrun ${abs_top_builddir}/src/strip -g -o strip.out -f debug.out ||
+ { echo "*** failed to strip -g -o strip.out -f debug.out a.out"; exit -1; }
+
+ status=0
+ testrun ${abs_top_builddir}/src/readelf -S strip.out > readelf.out
+ grep SYMTAB readelf.out || status=$?
+ echo $status
+ if test $status -ne 0; then
+ echo no symtab found in strip.out
+ exit 1
+ fi
+
+ status=0
+ testrun ${abs_top_builddir}/src/readelf -S debug.out > readelf.out
+ grep SYMTAB readelf.out || status=$?
+ echo $status
+ if test $status -ne 1; then
+ echo symtab found in debug.out
+ exit 1
+ fi
+
+ # aarch64 (with data marker in .debug_frame). See tests/run-addrcfi.sh
+ testfiles testfileaarch64
+
+ echo aarch64 strip -g to file with debug file
+ testrun ${abs_top_builddir}/src/strip -g -o strip.out -f debug.out testfileaarch64 ||
+ { echo "*** failed to strip -g -o strip.out -f debug.out a.out"; exit -1; }
+
+ status=0
+ testrun ${abs_top_builddir}/src/readelf -S strip.out > readelf.out
+ grep SYMTAB readelf.out || status=$?
+ echo $status
+ if test $status -ne 0; then
+ echo no symtab found in strip.out
+ exit 1
+ fi
+
+ status=0
+ testrun ${abs_top_builddir}/src/readelf -S debug.out > readelf.out
+ grep SYMTAB readelf.out || status=$?
+ echo $status
+ if test $status -ne 1; then
+ echo symtab found in debug.out
+ exit 1
+ fi
+
+ exit 0