From 07737584e73714eff3481fcf17f9f0331c8a5b88 Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Fri, 18 Aug 2017 12:41:11 +0200 Subject: Check for -z,defs, -z,relro, -fPIC, -fPIE before using them Those flags are not available on all platforms, and omitting them when not available will not cause any harm. In particular: -z,defs disallows undefined symbols in object files. This option is unsupported if the target binary format enforces the same condition already. Furthermore it is only a compile time sanity check. When it is omitted, the same binary is produced. -z,relro instructs the loader to mark sections read-only after loading the library, where possible. This is a hardening mechanism. If it is unavailable, the functionality of the code is not affected in any way. -fPIC instructs the compiler to produce position independent code. While this is preferable to relocatable code, relocatable code also works and may even be faster. Relocatable code might just be loaded into memory multiple times for different processes. -fPIE is the same thing as -fPIC for executables rather than shared libraries. Signed-off-by: Ulf Hermann --- config/ChangeLog | 4 ++++ config/eu.am | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'config') diff --git a/config/ChangeLog b/config/ChangeLog index 02cf76f9..1ed3c4af 100644 --- a/config/ChangeLog +++ b/config/ChangeLog @@ -1,3 +1,7 @@ +2017-04-27 Ulf Hermann + + * eu.am: Use fpic_CFLAGS. + 2016-08-02 Mark Wielaard * elfutils.spec.in: Update for 0.170. diff --git a/config/eu.am b/config/eu.am index 8fe1e259..796f3883 100644 --- a/config/eu.am +++ b/config/eu.am @@ -86,14 +86,14 @@ endif %.os: %.c %.o if AMDEP - $(AM_V_CC)if $(COMPILE.os) -c -o $@ -fPIC $(DEFS.os) -MT $@ -MD -MP \ + $(AM_V_CC)if $(COMPILE.os) -c -o $@ $(fpic_CFLAGS) $(DEFS.os) -MT $@ -MD -MP \ -MF "$(DEPDIR)/$*.Tpo" `test -f '$<' || echo '$(srcdir)/'`$<; \ then cat "$(DEPDIR)/$*.Tpo" >> "$(DEPDIR)/$*.Po"; \ rm -f "$(DEPDIR)/$*.Tpo"; \ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \ fi else - $(AM_V_CC)$(COMPILE.os) -c -o $@ -fPIC $(DEFS.os) $< + $(AM_V_CC)$(COMPILE.os) -c -o $@ $(fpic_CFLAGS) $(DEFS.os) $< endif CLEANFILES = *.gcno *.gcda -- cgit v1.2.3 From ab6b37ac32ddf2f2f11f800a770170814f5cbb8b Mon Sep 17 00:00:00 2001 From: Mark Wielaard Date: Tue, 24 Oct 2017 14:23:30 +0200 Subject: backends: Ignore GCC8 -Wpacked-not-aligned for m68k_corenote.c. The GCC8 -Wpacked-not-aligned warns if a structure field with explicit padding in a packed structure will be misaligned. m68k prstatus core notes are described by a packed structure which has such aligned structure fields. Signed-off-by: Mark Wielaard --- config/ChangeLog | 4 ++++ config/eu.am | 1 + 2 files changed, 5 insertions(+) (limited to 'config') diff --git a/config/ChangeLog b/config/ChangeLog index 1ed3c4af..de0d890d 100644 --- a/config/ChangeLog +++ b/config/ChangeLog @@ -1,3 +1,7 @@ +2017-10-24 Mark Wielaard + + * eu.am (AM_CFLAGS): Handle -Wno-packed-not-aligned. + 2017-04-27 Ulf Hermann * eu.am: Use fpic_CFLAGS. diff --git a/config/eu.am b/config/eu.am index 796f3883..05c27f02 100644 --- a/config/eu.am +++ b/config/eu.am @@ -74,6 +74,7 @@ AM_CFLAGS = -std=gnu99 -Wall -Wshadow -Wformat=2 \ $(if $($(*F)_no_Werror),,-Werror) \ $(if $($(*F)_no_Wunused),,-Wunused -Wextra) \ $(if $($(*F)_no_Wstack_usage),,$(STACK_USAGE_WARNING)) \ + $(if $($(*F)_no_Wpacked_not_aligned),-Wno-packed-not-aligned,) \ $($(*F)_CFLAGS) COMPILE.os = $(filter-out -fprofile-arcs -ftest-coverage, $(COMPILE)) -- cgit v1.2.3 From cc1d7e7612e9bd43a299fd1e2237f837f84e6f04 Mon Sep 17 00:00:00 2001 From: Mark Wielaard Date: Thu, 2 Nov 2017 16:53:10 +0100 Subject: config: files under /usr/lib/sysctl.d (_sysctldir) aren't %config. Admin can place the real config file under /etc/sysctl.d as override. https://bugzilla.redhat.com/show_bug.cgi?id=1506660 Signed-off-by: Mark Wielaard --- config/ChangeLog | 5 +++++ config/elfutils.spec.in | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) (limited to 'config') diff --git a/config/ChangeLog b/config/ChangeLog index de0d890d..ae40cc07 100644 --- a/config/ChangeLog +++ b/config/ChangeLog @@ -1,3 +1,8 @@ +2017-11-02 Mark Wielaard + + * elfutils.spec.in: Config files under /usr/lib/sysctl.d (_sysctldir) + aren't %config. + 2017-10-24 Mark Wielaard * eu.am (AM_CFLAGS): Handle -Wno-packed-not-aligned. diff --git a/config/elfutils.spec.in b/config/elfutils.spec.in index 439fcb73..1d0a4f8e 100644 --- a/config/elfutils.spec.in +++ b/config/elfutils.spec.in @@ -224,10 +224,10 @@ rm -rf ${RPM_BUILD_ROOT} %{_libdir}/libelf.a %files default-yama-scope -%config(noreplace) %{_sysctldir}/10-default-yama-scope.conf +%{_sysctldir}/10-default-yama-scope.conf %changelog -* Wed Aug 2 2017 Mark Wielaard 0.170-1 +* Wed Aug 2 2017 Mark Wielaard 0.170-1 - libdw: Added new DWARF5 attribute, tag, character encoding, language code, calling convention, defaulted member function and macro constants to dwarf.h. -- cgit v1.2.3 From 555e15ebe8bf1eb33d00747173cfc80cc65648a4 Mon Sep 17 00:00:00 2001 From: Joshua Watt Date: Fri, 9 Feb 2018 10:27:18 -0600 Subject: Use fallthrough attribute. Use __attribute__ ((fallthrough)) to indicate switch case fall through instead of a comment. This ensures that the fallthrough warning is not triggered even if the file is pre-processed (hence stripping the comments) before it is compiled. The actual fallback implementation is hidden behind a FALLBACK macro in case the compiler doesn't support it. Finally, the -Wimplict-fallthrough warning was upgraded to only allow the attribute to satisfy it; a comment alone is no longer sufficient. Signed-off-by: Joshua Watt --- config/ChangeLog | 4 ++++ config/eu.am | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) (limited to 'config') diff --git a/config/ChangeLog b/config/ChangeLog index ae40cc07..681def2f 100644 --- a/config/ChangeLog +++ b/config/ChangeLog @@ -1,3 +1,7 @@ +2018-02-09 Joshua Watt + + * eu.am (IMPLICIT_FALLTHROUGH_WARNING): Set to 5. + 2017-11-02 Mark Wielaard * elfutils.spec.in: Config files under /usr/lib/sysctl.d (_sysctldir) diff --git a/config/eu.am b/config/eu.am index 05c27f02..c2cc349c 100644 --- a/config/eu.am +++ b/config/eu.am @@ -62,7 +62,9 @@ NULL_DEREFERENCE_WARNING= endif if HAVE_IMPLICIT_FALLTHROUGH_WARNING -IMPLICIT_FALLTHROUGH_WARNING=-Wimplicit-fallthrough +# Use strict fallthrough. Only __attribute__((fallthrough)) will prevent the +# warning +IMPLICIT_FALLTHROUGH_WARNING=-Wimplicit-fallthrough=5 else IMPLICIT_FALLTHROUGH_WARNING= endif -- cgit v1.2.3 From cf65ca1428a5e300e6c6813d5b17e01e16570add Mon Sep 17 00:00:00 2001 From: Mark Wielaard Date: Fri, 1 Jun 2018 21:16:56 +0200 Subject: Prepare for 0.171. Set version to 0.171. Update po/*.po files. Mention DWARF5, split dwarf and GNU DebugFission support in NEWS. Signed-off-by: Mark Wielaard --- config/ChangeLog | 4 ++++ config/elfutils.spec.in | 14 ++++++++++++++ 2 files changed, 18 insertions(+) (limited to 'config') diff --git a/config/ChangeLog b/config/ChangeLog index 681def2f..5b3d83e2 100644 --- a/config/ChangeLog +++ b/config/ChangeLog @@ -1,3 +1,7 @@ +2018-06-01 Mark Wielaard + + * elfutils.spec.in: Update for 0.171. + 2018-02-09 Joshua Watt * eu.am (IMPLICIT_FALLTHROUGH_WARNING): Set to 5. diff --git a/config/elfutils.spec.in b/config/elfutils.spec.in index 1d0a4f8e..4c49a141 100644 --- a/config/elfutils.spec.in +++ b/config/elfutils.spec.in @@ -227,6 +227,20 @@ rm -rf ${RPM_BUILD_ROOT} %{_sysctldir}/10-default-yama-scope.conf %changelog +* Fri Jun 01 2018 Mark Wielaard 0.171-1 +- DWARF5 and split dwarf, including GNU DebugFission, support. +- readelf: Handle all new DWARF5 sections. + --debug-dump=info+ will show split unit DIEs when found. + --dwarf-skeleton can be used when inspecting a .dwo file. + Recognizes GNU locviews with --debug-dump=loc. +- libdw: New functions dwarf_die_addr_die, dwarf_get_units, + dwarf_getabbrevattr_data and dwarf_cu_info. + libdw will now try to resolve the alt file on first use + when not set yet with dwarf_set_alt. + dwarf_aggregate_size() now works with multi-dimensional arrays. +- libdwfl: Use process_vm_readv when available instead of ptrace. +- backends: Add a RISC-V backend. + * Wed Aug 2 2017 Mark Wielaard 0.170-1 - libdw: Added new DWARF5 attribute, tag, character encoding, language code, calling convention, defaulted member function -- cgit v1.2.3 From 7a1fd63a74e456f0ad9ab954bc381050e702eeb6 Mon Sep 17 00:00:00 2001 From: Mark Wielaard Date: Mon, 11 Jun 2018 17:14:39 +0200 Subject: Prepare for 0.172. It has been only 10 days since the previous release and there are no functional changes compared to 0.171. The speedup of eu-readelf -N is pretty nice. And ~25 patches fix various bugs (hangs and crashes) in dealing with bad DWARF5 data. Most have been found by running the afl fuzzer on eu-readelf and various testcases. Signed-off-by: Mark Wielaard --- config/ChangeLog | 4 ++++ config/elfutils.spec.in | 7 +++++++ 2 files changed, 11 insertions(+) (limited to 'config') diff --git a/config/ChangeLog b/config/ChangeLog index 5b3d83e2..0e9cc28c 100644 --- a/config/ChangeLog +++ b/config/ChangeLog @@ -1,3 +1,7 @@ +2018-06-11 Mark Wielaard + + * elfutils.spec.in: Update for 0.172. + 2018-06-01 Mark Wielaard * elfutils.spec.in: Update for 0.171. diff --git a/config/elfutils.spec.in b/config/elfutils.spec.in index 4c49a141..8e41f46a 100644 --- a/config/elfutils.spec.in +++ b/config/elfutils.spec.in @@ -227,6 +227,13 @@ rm -rf ${RPM_BUILD_ROOT} %{_sysctldir}/10-default-yama-scope.conf %changelog +* Mon Jun 11 2018 Mark Wielaard 0.172-1 +- No functional changes compared to 0.171. +- Various bug fixes in libdw and eu-readelf dealing with bad DWARF5 + data. Thanks to running the afl fuzzer on eu-readelf and various + testcases. +- eu-readelf -N is ~15% faster. + * Fri Jun 01 2018 Mark Wielaard 0.171-1 - DWARF5 and split dwarf, including GNU DebugFission, support. - readelf: Handle all new DWARF5 sections. -- cgit v1.2.3 From aa36de0335e3ce12898954985a208f6336731289 Mon Sep 17 00:00:00 2001 From: Mark Wielaard Date: Fri, 29 Jun 2018 21:02:18 +0200 Subject: Prepare for 0.173 Set version to 0.173. Mention new functionality in NEWS. Update po/*.po files. Signed-off-by: Mark Wielaard --- config/elfutils.spec.in | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'config') diff --git a/config/elfutils.spec.in b/config/elfutils.spec.in index 8e41f46a..b64cc287 100644 --- a/config/elfutils.spec.in +++ b/config/elfutils.spec.in @@ -227,6 +227,21 @@ rm -rf ${RPM_BUILD_ROOT} %{_sysctldir}/10-default-yama-scope.conf %changelog +* Fri Jun 29 2018 Mark Wielaard,,, 0.173-1 +- More fixes for crashes and hangs found by afl-fuzz. In particular + various functions now detect and break infinite loops caused by bad + DIE tree cycles. +- readelf: Will now lookup the size and signedness of constant value + types to display them correctly (and not just how they were encoded). +- libdw: New function dwarf_next_lines to read CU-less .debug_line data. + dwarf_begin_elf now accepts ELF files containing just .debug_line + or .debug_frame sections (which can be read without needing a DIE + tree from the .debug_info section). + Removed dwarf_getscn_info, which was never implemented. +- backends: Handle BPF simple relocations. + The RISCV backends now handles ABI specific CFI and knows about + RISCV register types and names. + * Mon Jun 11 2018 Mark Wielaard 0.172-1 - No functional changes compared to 0.171. - Various bug fixes in libdw and eu-readelf dealing with bad DWARF5 -- cgit v1.2.3