]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
Merge branch 'master' into portable
authorMark Wielaard <mjw@redhat.com>
Sun, 18 May 2014 14:44:06 +0000 (16:44 +0200)
committerMark Wielaard <mjw@redhat.com>
Sun, 18 May 2014 14:54:23 +0000 (16:54 +0200)
Conflicts:
backends/Makefile.am
config/eu.am
libdwfl/linux-pid-attach.c
src/Makefile.am

24 files changed:
1  2 
ChangeLog
backends/ChangeLog
backends/Makefile.am
config/ChangeLog
config/eu.am
configure.ac
lib/ChangeLog
libasm/ChangeLog
libcpu/ChangeLog
libdw/ChangeLog
libdw/dwarf_begin_elf.c
libdw/libdw.h
libdwfl/ChangeLog
libdwfl/linux-pid-attach.c
libelf/ChangeLog
src/ChangeLog
src/Makefile.am
src/addr2line.c
src/readelf.c
src/strings.c
src/strip.c
tests/ChangeLog
tests/Makefile.am
tests/backtrace.c

diff --cc ChangeLog
Simple merge
Simple merge
index 01774a911233fdcd6e6eefdcef6ceb9375aa7e98,e06841c03d7cbacda2bf7e7c5c01b025a393962d..5b49108b2be15d24e373fb7ef37fd841aff1d25d
@@@ -124,7 -119,7 +119,7 @@@ libebl_%.so libebl_%.map: libebl_%_pic.
        $(LINK) -shared -o $(@:.map=.so) \
                -Wl,--whole-archive $< $(cpu_$*) -Wl,--no-whole-archive \
                -Wl,--version-script,$(@:.so=.map) \
-               -Wl,-z,defs $(LD_AS_NEEDED) $(libelf) $(libdw) $(libmudflap)
 -              -Wl,-z,defs -Wl,--as-needed $(libelf) $(libdw)
++              -Wl,-z,defs $(LD_AS_NEEDED) $(libelf) $(libdw)
        $(textrel_check)
  
  libebl_i386.so: $(cpu_i386)
Simple merge
diff --cc config/eu.am
index 888664ef4c285e1898180d75975cb15b9b4bfce0,c3b00e08dffc09470de769d4853e0f39bcad33ae..3b7ed41f21d6f12094caa6d931b8ad94af61f643
@@@ -1,6 -1,6 +1,6 @@@
  ## Common automake fragments for elfutils subdirectory makefiles.
  ##
- ## Copyright (C) 2010-2011 Red Hat, Inc.
 -## Copyright (C) 2010, 2014 Red Hat, Inc.
++## Copyright (C) 2010-2011, 2014 Red Hat, Inc.
  ##
  ## This file is part of elfutils.
  ##
  ## not, see <http://www.gnu.org/licenses/>.
  ##
  
 +WEXTRA = @WEXTRA@
 +LD_AS_NEEDED = @LD_AS_NEEDED@
 +
  DEFS = -D_GNU_SOURCE -DHAVE_CONFIG_H -DLOCALEDIR='"${localedir}"'
  AM_CPPFLAGS = -I. -I$(srcdir) -I$(top_srcdir)/lib -I..
 -AM_CFLAGS = -std=gnu99 -Wall -Wshadow -Wformat=2 \
 +AM_CFLAGS = -std=gnu99 -Wall -Wshadow \
+           $(if $($(*F)_no_Werror),,-Werror) \
 -          $(if $($(*F)_no_Wunused),,-Wunused -Wextra) \
 +          $(if $($(*F)_no_Wunused),,-Wunused $(WEXTRA)) \
 +          $(if $($(*F)_no_Wformat),-Wno-format,-Wformat=2) \
            $($(*F)_CFLAGS)
  
- if MUDFLAP
- AM_CFLAGS += -fmudflap
- libmudflap = -lmudflap
- else
- libmudflap =
- endif
- COMPILE.os = $(filter-out -fprofile-arcs -ftest-coverage $(no_mudflap.os),\
-                         $(COMPILE))
 +if BUILD_WERROR
 +AM_CFLAGS += $(if $($(*F)_no_Werror),,-Werror)
 +endif
 +
+ COMPILE.os = $(filter-out -fprofile-arcs -ftest-coverage, $(COMPILE))
  
  %.os: %.c %.o
  if AMDEP
diff --cc configure.ac
index ee4357927258d0c779391dee0d5277d36c687148,1d79597a3a7d5423ed466e2ba550f37708c0e66c..b9f382c357b4084f5ccede10c5d3cf128cff3adc
  AM_CONDITIONAL(USE_VALGRIND, test "$use_valgrind" = yes)
  
  AM_CONDITIONAL(BUILD_STATIC, [dnl
- test "$use_mudflap" = yes -o "$use_gprof" = yes -o "$use_gcov" = yes])
+ test "$use_gprof" = yes -o "$use_gcov" = yes])
  
 +AC_ARG_ENABLE([werror],
 +AS_HELP_STRING([--disable-werror],[do not build with -Werror]),
 +             [enable_werror=$enableval], [enable_werror=yes])
 +AM_CONDITIONAL(BUILD_WERROR, test "$enable_werror" = yes)
 +
  AC_ARG_ENABLE([tests-rpath],
  AS_HELP_STRING([--enable-tests-rpath],[build $ORIGIN-using rpath into tests]),
               [tests_use_rpath=$enableval], [tests_use_rpath=no])
diff --cc lib/ChangeLog
Simple merge
Simple merge
Simple merge
diff --cc libdw/ChangeLog
Simple merge
Simple merge
diff --cc libdw/libdw.h
Simple merge
Simple merge
index b8a3c3ed1aa2f268d62d1b1374f8fc94bec9abfc,8aee721169ee052f3a56ee6c27f27d7db6fe56be..2767e601d50f1ea68090405f2b29627601ee1412
@@@ -259,6 -251,19 +251,33 @@@ pid_detach (Dwfl *dwfl __attribute__ ((
    free (pid_arg);
  }
  
+ void
+ internal_function
+ __libdwfl_ptrace_detach (pid_t tid, bool tid_was_stopped)
+ {
++  // Older kernels (tested kernel-2.6.18-348.12.1.el5.x86_64) need special
++  // handling of the detachment to keep the process State: T (stopped).
++  if (tid_was_stopped)
++    syscall (__NR_tkill, tid, SIGSTOP);
++
+   /* This handling is needed only on older Linux kernels such as
+      2.6.32-358.23.2.el6.ppc64.  Later kernels such as
+      3.11.7-200.fc19.x86_64 remember the T (stopped) state
+      themselves and no longer need to pass SIGSTOP during
+      PTRACE_DETACH.  */
+   ptrace (PTRACE_DETACH, tid, NULL,
+         (void *) (intptr_t) (tid_was_stopped ? SIGSTOP : 0));
++
++  if (tid_was_stopped)
++    {
++      // Wait till the SIGSTOP settles down.
++      int i;
++      for (i = 0; i < 100000; i++)
++      if (linux_proc_pid_is_stopped (tid))
++        break;
++    }
+ }
  static void
  pid_thread_detach (Dwfl_Thread *thread, void *thread_arg)
  {
Simple merge
diff --cc src/ChangeLog
Simple merge
diff --cc src/Makefile.am
index 650a1c021f64975f02b8e3c844d4a6f05a7d06d0,9829f15b97c2fd87cb50e9cd1a582f29e48ff910..2787532f03205b6583477b558e5a83d211fa03ca
@@@ -91,19 -89,12 +89,17 @@@ endi
  # XXX While the file is not finished, don't warn about this
  ldgeneric_no_Wunused = yes
  
- # Buggy old compilers.
++# Buggy old compilers or libc headers.
 +readelf_no_Werror = yes
++strings_no_Werror = yes
++addr2line_no_Wformat = yes
 +
- readelf_LDADD = $(libdw) $(libebl) $(libelf) $(libeu) $(libmudflap) -ldl
- nm_LDADD = $(libdw) $(libebl) $(libelf) $(libeu) $(libmudflap) -ldl \
+ readelf_LDADD = $(libdw) $(libebl) $(libelf) $(libeu) -ldl
+ nm_LDADD = $(libdw) $(libebl) $(libelf) $(libeu) -ldl \
           $(demanglelib)
- size_LDADD = $(libelf) $(libeu) $(libmudflap)
- strip_LDADD = $(libebl) $(libelf) $(libeu) $(libmudflap) -ldl
- ld_LDADD = $(libebl) $(libelf) $(libeu) $(libmudflap) -ldl
+ size_LDADD = $(libelf) $(libeu)
+ strip_LDADD = $(libebl) $(libelf) $(libeu) -ldl
+ ld_LDADD = $(libebl) $(libelf) $(libeu) -ldl
  if NATIVE_LD
  # -ldl is always needed for libebl.
  ld_LDADD += libld_elf.a
diff --cc src/addr2line.c
Simple merge
diff --cc src/readelf.c
Simple merge
diff --cc src/strings.c
Simple merge
diff --cc src/strip.c
Simple merge
diff --cc tests/ChangeLog
Simple merge
index eae64a8398b8be33a59d2376260b4370eb1c6031,4cc81c9ca2efe2825f216e785ffe591efb61a785..71039a84d08c09a30811fe00b44003b70c87e96f
@@@ -321,71 -332,70 +332,71 @@@ libebl = ../libebl/libebl.
  libeu = ../lib/libeu.a
  endif !STANDALONE
  
- arextract_LDADD = $(libelf) $(libmudflap)
- arsymtest_LDADD = $(libelf) $(libmudflap)
- newfile_LDADD = $(libelf) $(libmudflap)
- saridx_LDADD = $(libelf) $(libmudflap)
- scnnames_LDADD = $(libelf) $(libmudflap)
- sectiondump_LDADD = $(libelf) $(libmudflap)
- showptable_LDADD = $(libelf) $(libmudflap)
- hash_LDADD = $(libelf) $(libmudflap)
- test_nlist_LDADD = $(libelf) $(libmudflap)
- msg_tst_LDADD = $(libelf) $(libmudflap)
- newscn_LDADD = $(libelf) $(libmudflap)
- early_offscn_LDADD = $(libelf) $(libmudflap)
- ecp_LDADD = $(libelf) $(libmudflap)
- update1_LDADD = $(libelf) $(libmudflap)
- update2_LDADD = $(libelf) $(libmudflap)
- update3_LDADD = $(libebl) $(libelf) $(libmudflap)
- update4_LDADD = $(libebl) $(libelf) $(libmudflap)
- show_die_info_LDADD = $(libdw) $(libelf) $(libmudflap)
- get_pubnames_LDADD = $(libdw) $(libelf) $(libmudflap)
- show_abbrev_LDADD = $(libdw) $(libelf) $(libmudflap)
- get_lines_LDADD = $(libdw) $(libelf) $(libmudflap)
- get_files_LDADD = $(libdw) $(libelf) $(libmudflap)
- get_aranges_LDADD = $(libdw) $(libelf) $(libmudflap)
- allfcts_LDADD = $(libdw) $(libelf) $(libmudflap)
+ arextract_LDADD = $(libelf)
+ arsymtest_LDADD = $(libelf)
+ newfile_LDADD = $(libelf)
+ saridx_LDADD = $(libelf)
+ scnnames_LDADD = $(libelf)
+ sectiondump_LDADD = $(libelf)
+ showptable_LDADD = $(libelf)
+ hash_LDADD = $(libelf)
+ test_nlist_LDADD = $(libelf)
+ msg_tst_LDADD = $(libelf)
+ newscn_LDADD = $(libelf)
+ early_offscn_LDADD = $(libelf)
+ ecp_LDADD = $(libelf)
+ update1_LDADD = $(libelf)
+ update2_LDADD = $(libelf)
+ update3_LDADD = $(libebl) $(libelf)
+ update4_LDADD = $(libebl) $(libelf)
+ show_die_info_LDADD = $(libdw) $(libelf)
+ get_pubnames_LDADD = $(libdw) $(libelf)
+ show_abbrev_LDADD = $(libdw) $(libelf)
+ get_lines_LDADD = $(libdw) $(libelf)
+ get_files_LDADD = $(libdw) $(libelf)
+ get_aranges_LDADD = $(libdw) $(libelf)
+ allfcts_LDADD = $(libdw) $(libelf)
 +line2addr_no_Wformat = yes
- line2addr_LDADD = $(libdw) $(libmudflap)
- addrscopes_LDADD = $(libdw) $(libmudflap)
- funcscopes_LDADD = $(libdw) $(libmudflap)
- funcretval_LDADD = $(libdw) $(libmudflap)
- allregs_LDADD = $(libdw) $(libmudflap)
- find_prologues_LDADD = $(libdw) $(libmudflap)
- #show_ciefde_LDADD = ../libdwarf/libdwarf.so $(libelf) $(libmudflap)
- asm_tst1_LDADD = $(libasm) $(libebl) $(libelf) $(libmudflap) -ldl
- asm_tst2_LDADD = $(libasm) $(libebl) $(libelf) $(libmudflap) -ldl
- asm_tst3_LDADD = $(libasm) $(libebl) $(libelf) $(libmudflap) -ldl
- asm_tst4_LDADD = $(libasm) $(libebl) $(libelf) $(libmudflap) -ldl
- asm_tst5_LDADD = $(libasm) $(libebl) $(libelf) $(libmudflap) -ldl
- asm_tst6_LDADD = $(libasm) $(libebl) $(libelf) $(libmudflap) -ldl
- asm_tst7_LDADD = $(libasm) $(libebl) $(libelf) $(libmudflap) -ldl
- asm_tst8_LDADD = $(libasm) $(libebl) $(libelf) $(libmudflap) -ldl
- asm_tst9_LDADD = $(libasm) $(libebl) $(libelf) $(libmudflap) -ldl
- dwflmodtest_LDADD = $(libdw) $(libebl) $(libelf) $(libmudflap) -ldl
- rdwrmmap_LDADD = $(libelf) $(libmudflap)
- dwfl_bug_addr_overflow_LDADD = $(libdw) $(libebl) $(libelf) $(libmudflap) -ldl
- arls_LDADD = $(libelf) $(libmudflap)
- dwfl_bug_fd_leak_LDADD = $(libdw) $(libebl) $(libelf) $(libmudflap) -ldl
- dwfl_bug_report_LDADD = $(libdw) $(libebl) $(libelf) $(libmudflap) -ldl
- dwfl_bug_getmodules_LDADD = $(libdw) $(libebl) $(libelf) $(libmudflap) -ldl
- dwfl_addr_sect_LDADD = $(libdw) $(libebl) $(libelf) $(libmudflap) -ldl
- dwarf_getmacros_LDADD = $(libdw) $(libmudflap)
- dwarf_getstring_LDADD = $(libdw) $(libmudflap)
- addrcfi_LDADD = $(libdw) $(libebl) $(libelf) $(libmudflap) -ldl
- test_flag_nobits_LDADD = $(libelf) $(libmudflap)
- rerequest_tag_LDADD = $(libdw) $(libmudflap)
- alldts_LDADD = $(libebl) $(libelf) $(libmudflap)
+ line2addr_LDADD = $(libdw)
+ addrscopes_LDADD = $(libdw)
+ funcscopes_LDADD = $(libdw)
+ funcretval_LDADD = $(libdw)
+ allregs_LDADD = $(libdw)
+ find_prologues_LDADD = $(libdw)
+ #show_ciefde_LDADD = ../libdwarf/libdwarf.so $(libelf)
+ asm_tst1_LDADD = $(libasm) $(libebl) $(libelf) -ldl
+ asm_tst2_LDADD = $(libasm) $(libebl) $(libelf) -ldl
+ asm_tst3_LDADD = $(libasm) $(libebl) $(libelf) -ldl
+ asm_tst4_LDADD = $(libasm) $(libebl) $(libelf) -ldl
+ asm_tst5_LDADD = $(libasm) $(libebl) $(libelf) -ldl
+ asm_tst6_LDADD = $(libasm) $(libebl) $(libelf) -ldl
+ asm_tst7_LDADD = $(libasm) $(libebl) $(libelf) -ldl
+ asm_tst8_LDADD = $(libasm) $(libebl) $(libelf) -ldl
+ asm_tst9_LDADD = $(libasm) $(libebl) $(libelf) -ldl
+ dwflmodtest_LDADD = $(libdw) $(libebl) $(libelf) -ldl
+ rdwrmmap_LDADD = $(libelf)
+ dwfl_bug_addr_overflow_LDADD = $(libdw) $(libebl) $(libelf) -ldl
+ arls_LDADD = $(libelf)
+ dwfl_bug_fd_leak_LDADD = $(libdw) $(libebl) $(libelf) -ldl
+ dwfl_bug_report_LDADD = $(libdw) $(libebl) $(libelf) -ldl
+ dwfl_bug_getmodules_LDADD = $(libdw) $(libebl) $(libelf) -ldl
+ dwfl_addr_sect_LDADD = $(libdw) $(libebl) $(libelf) -ldl
+ dwarf_getmacros_LDADD = $(libdw)
+ dwarf_getstring_LDADD = $(libdw)
+ addrcfi_LDADD = $(libdw) $(libebl) $(libelf) -ldl
+ test_flag_nobits_LDADD = $(libelf)
+ rerequest_tag_LDADD = $(libdw)
+ alldts_LDADD = $(libebl) $(libelf)
  md5_sha1_test_LDADD = $(libeu)
- typeiter_LDADD = $(libdw) $(libelf) $(libmudflap)
- typeiter2_LDADD = $(libdw) $(libelf) $(libmudflap)
- low_high_pc_LDADD = $(libdw) $(libelf) $(libmudflap)
- test_elf_cntl_gelf_getshdr_LDADD = $(libelf) $(libmudflap)
- dwflsyms_LDADD = $(libdw) $(libelf) $(libmudflap)
- dwfllines_LDADD = $(libdw) $(libelf) $(libmudflap)
- dwfl_report_elf_align_LDADD = $(libdw) $(libmudflap)
- varlocs_LDADD = $(libdw) $(libelf) $(libmudflap)
- backtrace_LDADD = $(libdw) $(libelf) $(libmudflap)
+ typeiter_LDADD = $(libdw) $(libelf)
+ typeiter2_LDADD = $(libdw) $(libelf)
+ low_high_pc_LDADD = $(libdw) $(libelf)
+ test_elf_cntl_gelf_getshdr_LDADD = $(libelf)
+ dwflsyms_LDADD = $(libdw) $(libelf)
+ dwfllines_LDADD = $(libdw) $(libelf)
+ dwfl_report_elf_align_LDADD = $(libdw)
+ varlocs_LDADD = $(libdw) $(libelf)
+ backtrace_LDADD = $(libdw) $(libelf)
  # backtrace-child-biarch also uses those *_CFLAGS and *_LDLAGS variables:
  backtrace_child_CFLAGS = -fPIE
  backtrace_child_LDFLAGS = -pie -pthread
index 16b6da3ce5e965e7766b4f53459182b45796f031,1a4709b9df1ade126aad14f4694c045835f58c3a..515f184977cd04472cf27f315a51cbfe0086f6f4
  #include <fcntl.h>
  #include <string.h>
  #include <argp.h>
 +#include <sys/syscall.h>
  #include ELFUTILS_HEADER(dwfl)
  
+ #ifndef __linux__
+ int
+ main (int argc __attribute__ ((unused)), char **argv)
+ {
+   fprintf (stderr, "%s: Unwinding not supported for this architecture\n",
+          argv[0]);
+   return 77;
+ }
+ #else /* __linux__ */
  static int
  dump_modules (Dwfl_Module *mod, void **userdata __attribute__ ((unused)),
              const char *name, Dwarf_Addr start,