Commit Graph

196 Commits

Author SHA1 Message Date
Tom de Vries 518a3a2106 [libbacktrace] Factor out backtrace_vector_free
Factor out new function backtrace_vector_free.

Bootstrapped and reg-tested on x86_64.

2018-11-30  Tom de Vries  <tdevries@suse.de>

	* internal.h (backtrace_vector_free): New static inline fuction,
	factored out of ...
	* dwarf.c (read_line_info): ... here.

From-SVN: r266658
2018-11-30 08:43:50 +00:00
Tom de Vries 18c742b5f0 [libbacktrace] Fix segfault upon allocation failure
If the allocation of abbrevs->abbrevs in read_abbrevs fails, then
abbrevs->num_abbrevs remains nonzero, and consequently free_abbrevs will
segfault when accessing abbrevs->abbrevs.

Fix this by setting abbrevs->num_abbrevs only after abbrevs->abbrevs
allocation has succeeded.

Bootstrapped and reg-tested on x86_64.

2018-11-28  Tom de Vries  <tdevries@suse.de>

	* dwarf.c (read_abbrevs): Fix handling of abbrevs->abbrevs allocation
	failure.

From-SVN: r266562
2018-11-28 14:06:23 +00:00
Tom de Vries 6d760a0197 [libbacktrace] Don't point to released memory in backtrace_vector_release
When backtrace_vector_release is called with vec.size == 0, it releases the
memory pointed at by vec.base.

Set vec.base set to NULL if vec.size == 0 to ensure we don't point to released
memory.

Bootstrapped and reg-tested on x86_64.

2018-11-27  Tom de Vries  <tdevries@suse.de>

	* mmap.c (backtrace_vector_release): Same.
	* unittest.c (test1): Add check.

From-SVN: r266505
2018-11-27 08:26:04 +00:00
Tom de Vries 0c155f24a9 [libbacktrace] Avoid realloc with size == 0 in backtrace_vector_release
As of C17, realloc with size 0 is marked as an obsolescent feature.

Fix this in backtrace_vector_release by using free instead.

Bootstrapped and reg-tested on x86_64.

2018-11-27  Tom de Vries  <tdevries@suse.de>

	* alloc.c (backtrace_vector_release): Handle vec->size == 0 using free
	instead of realloc.
	* Makefile.am (check_PROGRAMS): Add unittest.
	* Makefile.in: Regenerate.
	* unittest.c: New file.

From-SVN: r266504
2018-11-27 08:25:52 +00:00
Tom de Vries 292592c5da [libbacktrace] Factor out read_initial_length
Factor out new function read_initial_length in dwarf.c.

Bootstrapped and reg-tested on x86_64.

2018-11-22  Tom de Vries  <tdevries@suse.de>

	* dwarf.c (read_initial_length): Factor out of ...
	(build_address_map, read_line_info): ... here.

From-SVN: r266361
2018-11-22 00:06:27 +00:00
Tom de Vries 171125708a [libbacktrace] Factor out read_string
Factor out new function read_string in dwarf.c.

Bootstrapped and reg-tested on x86_64.

2018-11-21  Tom de Vries  <tdevries@suse.de>

	* dwarf.c (read_string): Factor out of ...
	(read_attribute, read_line_header, read_line_program): ... here.

From-SVN: r266339
2018-11-21 08:31:04 +00:00
Joseph Myers 22e0527251 Update GCC to autoconf 2.69, automake 1.15.1 (PR bootstrap/82856).
This patch updates GCC to use autoconf 2.69 and automake 1.15.1.
(That's not the latest automake version, but it's the one used by
binutils-gdb, with which consistency is desirable, and in any case
seems a useful incremental update that should make a future update to
1.16.1 easier.)

The changes are generally similar to the binutils-gdb ones, and are
copied from there where shared files and directories are involved
(there are some further changes to such shared directories, however,
which I'd expect to apply to binutils-gdb once this patch is in GCC).
Largely, obsolete AC_PREREQ calls are removed, while many
AC_LANG_SOURCE calls are added to avoid warnings from aclocal and
autoconf.  Multilib support is no longer included in core automake,
meaning that multilib.am needs copying from automake's contrib
directory into the GCC source tree.  Autoconf 2.69 has Go support, so
local copies of that support are removed.  I hope the D support will
soon be submitted to upstream autoconf so the local copy of that can
be removed in a future update.  Changes to how automake generates
runtest calls mean quotes are removed from RUNTEST definitions in five
lib*/testsuite/Makefile.am files (libatomic, libgomp, libitm,
libphobos, libvtv; some others have RUNTEST definitions without
quotes, which are still OK); libgo and libphobos also get
-Wno-override added to AM_INIT_AUTOMAKE so those overrides of RUNTEST
do not generate automake warnings.

Note that the regeneration did not include regeneration of
fixincludes/config.h.in (attempting such regeneration resulted in all
the USED_FOR_TARGET conditionals disappearing; and I don't see
anything in the fixincludes/ directory that would result in such
conditionals being generated, unlike in the gcc/ directory).  Also
note that libvtv/testsuite/other-tests/Makefile.in was not
regenerated; that directory is not listed as a subdirectory for which
Makefile.in gets regenerated by calling "automake" in libvtv/, so I'm
not sure how it's meant to be regenerated.

While I mostly fixed warnings should running aclocal / automake /
autoconf, there were various such warnings from automake in the
libgfortran, libgo, libgomp, liboffloadmic, libsanitizer, libphobos
directories that I did not fix, preferring to leave those to the
relevant subsystem maintainers.  Specifically, most of those warnings
were of the following form (example from libgfortran):

Makefile.am:48: warning: source file 'caf/single.c' is in a subdirectory,
Makefile.am:48: but option 'subdir-objects' is disabled
automake: warning: possible forward-incompatibility.
automake: At least a source file is in a subdirectory, but the 'subdir-objects'
automake: automake option hasn't been enabled.  For now, the corresponding output
automake: object file(s) will be placed in the top-level directory.  However,
automake: this behaviour will change in future Automake versions: they
will
automake: unconditionally cause object files to be placed in the same subdirectory
automake: of the corresponding sources.
automake: You are advised to start using 'subdir-objects' option throughout your
automake: project, to avoid future incompatibilities.

I think it's best for the relevant maintainers to add subdir-objects
and do any other associated Makefile.am changes needed.  In some cases
the paths in the warnings involved ../; I don't know if that adds any
extra complications to the use of subdir-objects.

I've tested this with native, cross and Canadian cross builds.  The
risk of any OS-specific issues should I hope be rather lower than if a
libtool upgrade were included (we *should* do such an upgrade at some
point, but it's more complicated - it involves identifying all our
local libtool changes to see if any aren't included in the upstream
version we update to, and reverting an upstream libtool patch that's
inappropriate for use in GCC); I think it would be better to get this
update into GCC so that people can test in different configurations
and we can fix any issues found, rather than to try to get more and
more testing done before it goes in.

top level:
2018-10-31  Joseph Myers  <joseph@codesourcery.com>

	PR bootstrap/82856
	* multilib.am: New file.  From automake.

	Merge from binutils-gdb:
	2018-06-19  Simon Marchi  <simon.marchi@ericsson.com>

	* libtool.m4: Use AC_LANG_SOURCE.
	* configure.ac: Remove AC_PREREQ, use AC_LANG_SOURCE.
	* ar-lib: New file.
	* test-driver: New file.
	* configure: Re-generate.

config:
2018-10-31  Joseph Myers  <joseph@codesourcery.com>

	PR bootstrap/82856
	* math.m4, tls.m4: Use AC_LANG_SOURCE.

	Merge from binutils-gdb:
	2018-06-19  Simon Marchi  <simon.marchi@ericsson.com>

	* override.m4 (_GCC_AUTOCONF_VERSION): Bump from 2.64 to 2.69.

fixincludes:
2018-10-31  Joseph Myers  <joseph@codesourcery.com>

	PR bootstrap/82856
	* configure.ac: Remove AC_PREREQ.
	* aclocal.m4, configure: Regenerate.

gcc:
2018-10-31  Joseph Myers  <joseph@codesourcery.com>

	PR bootstrap/82856
	* configure.ac: Remove AC_PREREQ.  Use AC_LANG_SOURCE.  Use single
	line for second argument of AC_DEFINE_UNQUOTED.
	* doc/install.texi (Tools/packages necessary for modifying GCC):
	Update to autoconf 2.69 and automake 1.15.1.
	* aclocal.m4, config.in, configure: Regenerate.

gnattools:
2018-10-31  Joseph Myers  <joseph@codesourcery.com>

	PR bootstrap/82856
	* configure.ac: Remove AC_PREREQ.
	* configure: Regenerate.

gotools:
2018-10-31  Joseph Myers  <joseph@codesourcery.com>

	PR bootstrap/82856
	* config/go.m4: Remove file.
	* Makefile.am (ACLOCAL_AMFLAGS): Do not use -I ./config.
	* configure.ac:  Remove AC_PREREQ.  Do not include config/go.m4.
	* Makefile.in, aclocal.m4, configure: Regenerate.

intl:
2018-10-31  Joseph Myers  <joseph@codesourcery.com>

	PR bootstrap/82856
	Merge from binutils-gdb:
	2018-06-19  Simon Marchi  <simon.marchi@ericsson.com>

	* configure.ac: Add AC_USE_SYSTEM_EXTENSIONS, remove AC_PREREQ.
	* configure: Re-generate.
	* config.h.in: Re-generate.
	* aclocal.m4: Re-generate.

libada:
2018-10-31  Joseph Myers  <joseph@codesourcery.com>

	PR bootstrap/82856
	* configure.ac: Remove AC_PREREQ.
	* configure: Regenerate.

libatomic:
2018-10-31  Joseph Myers  <joseph@codesourcery.com>

	PR bootstrap/82856
	* Makefile.am: Include multilib.am.
	* acinclude.m4: Use AC_LANG_SOURCE.
	* configure.ac: Remove AC_PREREQ.
	* testsuite/Makefile.am (RUNTEST): Remove quotes.
	* Makefile.in, aclocal.m4, configure, testsuite/Makefile.in:
	Regenerate.

libbacktrace:
2018-10-31  Joseph Myers  <joseph@codesourcery.com>

	PR bootstrap/82856
	* Makefile.am: Include multilib.am.
	* configure.ac: Remove AC_PREREQ.  Use AC_LANG_SOURCE.
	* Makefile.in, aclocal.m4, config.h.in, configure: Regenerate.

libcc1:
2018-10-31  Joseph Myers  <joseph@codesourcery.com>

	PR bootstrap/82856
	* configure.ac: Remove AC_PREREQ.
	* Makefile.in, aclocal.m4, configure: Regenerate.

libcpp:
2018-10-31  Joseph Myers  <joseph@codesourcery.com>

	PR bootstrap/82856
	* configure.ac: Remove AC_PREREQ.  Use AC_LANG_SOURCE.
	* aclocal.m4, config.in, configure: Regenerate.

libdecnumber:
2018-10-31  Joseph Myers  <joseph@codesourcery.com>

	PR bootstrap/82856
	Merge from binutils-gdb:
	2018-06-19  Simon Marchi  <simon.marchi@ericsson.com>

	* configure.ac: Remove AC_PREREQ.
	* configure: Re-generate.
	* aclocal.m4.

libffi:
2018-10-31  Joseph Myers  <joseph@codesourcery.com>

	PR bootstrap/82856
	* Makefile.am: Include multilib.am.
	(AUTOMAKE_OPTIONS): Add info-in-builddir.
	(CLEANFILES): Remove doc/libffi.info.
	* configure.ac: Remove AC_PREREQ.
	* Makefile.in, aclocal.m4, configure, fficonfig.h.in,
	include/Makefile.in, man/Makefile.in, testsuite/Makefile.in:
	Regenerate.

libgcc:
2018-10-31  Joseph Myers  <joseph@codesourcery.com>

	PR bootstrap/82856
	* configure.ac: Remove AC_PREREQ.  Use AC_LANG_SOURCE.
	* configure: Regenerate.

libgfortran:
2018-10-31  Joseph Myers  <joseph@codesourcery.com>

	PR bootstrap/82856
	* Makefile.am: Include multilib.am.
	* configure.ac: Remove AC_PREREQ.
	* Makefile.in, aclocal.m4, config.h.in, configure: Regenerate.

libgo [logically part of this change but omitted from the commit]:
2018-10-31  Joseph Myers  <joseph@codesourcery.com>

	PR bootstrap/82856
	* Makefile.am: Include multilib.am.
	* config/go.m4: Remove file.
	* config/libtool.m4: Use AC_LANG_SOURCE.
	* configure.ac: Remove AC_PREREQ.  Use AC_LANG_SOURCE.  Use
	-Wno-override in AM_INIT_AUTOMAKE call.
	* Makefile.in, aclocal.m4, configure, testsuite/Makefile.in:
	Regenerate.

libgomp:
2018-10-31  Joseph Myers  <joseph@codesourcery.com>

	PR bootstrap/82856
	* Makefile.am: Include multilib.am
	(AUTOMAKE_OPTIONS): Add info-in-builddir.
	(CLEANFILES): Remove libgomp.info.
	* configure.ac: Remove AC_PREREQ.
	* testsuite/Makefile.am (RUNTEST): Remove quotes.
	* Makefile.in, aclocal.m4, configure, testsuite/Makefile.in:
	Regenerate.

libhsail-rt:
2018-10-31  Joseph Myers  <joseph@codesourcery.com>

	PR bootstrap/82856
	* configure.ac: Remove AC_PREREQ.
	* Makefile.in, aclocal.m4, configure: Regenerate.

libiberty:
2018-10-31  Joseph Myers  <joseph@codesourcery.com>

	PR bootstrap/82856
	Merge from binutils-gdb:
	2018-06-19  Simon Marchi  <simon.marchi@ericsson.com>

	* configure.ac: Remove AC_PREREQ.
	* configure: Re-generate.
	* config.in: Re-generate.

libitm:
2018-10-31  Joseph Myers  <joseph@codesourcery.com>

	PR bootstrap/82856
	* Makefile.am: Include multilib.am.
	(AUTOMAKE_OPTIONS): Add info-in-builddir.
	(CLEANFILES): Remove libitm.info.
	* configure.ac: Remove AC_PREREQ.
	* testsuite/Makefile.am (RUNTEST): Remove quotes.
	* Makefile.in, aclocal.m4, configure, testsuite/Makefile.in:
	Regenerate.

libobjc:
2018-10-31  Joseph Myers  <joseph@codesourcery.com>

	PR bootstrap/82856
	* configure.ac: Remove AC_PREREQ.
	* aclocal.m4, config.h.in, configure: Regenerate.

liboffloadmic:
2018-10-31  Joseph Myers  <joseph@codesourcery.com>

	PR bootstrap/82856
	* Makefile.am: Include multilib.am.
	* configure.ac: Remove AC_PREREQ.
	* plugin/Makefile.am: Include multilib.am.
	* plugin/configure.ac: Remove AC_PREREQ.
	* Makefile.in, aclocal.m4, configure, plugin/Makefile.in,
	plugin/aclocal.m4, plugin/configure: Regenerate.

libphobos:
2018-10-31  Joseph Myers  <joseph@codesourcery.com>

	PR bootstrap/82856
	* Makefile.am: Include multilib.am.
	* configure.ac: Remove AC_PREREQ.  Use -Wno-override in
	AM_INIT_AUTOMAKE call.
	* m4/autoconf.m4: Add extra argument to AC_LANG_DEFINE call.
	* m4/druntime/os.m4: Use AC_LANG_SOURCE.
	* testsuite/Makefile.am (RUNTEST): Remove quotes.
	* Makefile.in, aclocal.m4, configure, libdruntime/Makefile.in,
	src/Makefile.in, testsuite/Makefile.in: Regenerate.

libquadmath:
2018-10-31  Joseph Myers  <joseph@codesourcery.com>

	PR bootstrap/82856
	* Makefile.am: Include multilib.am.
	(AUTOMAKE_OPTIONS): Remove 1.8.  Add info-in-builddir.
	(all-local): Define outside conditional code.
	(CLEANFILES): Remove libquadmath.info.
	* configure.ac: Remove AC_PREREQ.
	* Makefile.in, aclocal.m4, config.h.in, configure: Regenerate.

libsanitizer:
2018-10-31  Joseph Myers  <joseph@codesourcery.com>

	PR bootstrap/82856
	* Makefile.am: Include multilib.am.
	* configure.ac: Remove AC_PREREQ.  Use AC_LANG_SOURCE.
	* Makefile.in, aclocal.m4, asan/Makefile.in, configure,
	interception/Makefile.in, libbacktrace/Makefile.in,
	lsan/Makefile.in, sanitizer_common/Makefile.in, tsan/Makefile.in,
	ubsan/Makefile.in: Regenerate.

libssp:
2018-10-31  Joseph Myers  <joseph@codesourcery.com>

	PR bootstrap/82856
	* Makefile.am: Include multilib.am.
	(AUTOMAKE_OPTIONS): Remove 1.9.5.
	* configure.ac: Remove AC_PREREQ.  Quote argument to
	AC_RUN_IFELSE.
	* Makefile.in, aclocal.m4, configure: Regenerate.

libstdc++-v3:
2018-10-31  Joseph Myers  <joseph@codesourcery.com>

	PR bootstrap/82856
	* Makefile.am: Include multilib.am.
	* configure.ac: Remove AC_PREREQ.
	* Makefile.in, aclocal.m4, configure, doc/Makefile.in,
	include/Makefile.in, libsupc++/Makefile.in, po/Makefile.in,
	python/Makefile.in, src/Makefile.in, src/c++11/Makefile.in,
	src/c++17/Makefile.in, src/c++98/Makefile.in,
	src/filesystem/Makefile.in, testsuite/Makefile.in: Regenerate.

libvtv:
2018-10-31  Joseph Myers  <joseph@codesourcery.com>

	PR bootstrap/82856
	* Makefile.am: Include multilib.am.
	* configure.ac: Remove AC_PREREQ.
	* testsuite/Makefile.am (RUNTEST): Remove quotes.
	* Makefile.in, aclocal.m4, configure, testsuite/Makefile.in:
	Regenerate.

lto-plugin:
2018-10-31  Joseph Myers  <joseph@codesourcery.com>

	PR bootstrap/82856
	* configure.ac: Remove AC_PREREQ.  Use AC_LANG_SOURCE.
	* Makefile.in, aclocal.m4, config.h.in, configure: Regenerate.

zlib:
2018-10-31  Joseph Myers  <joseph@codesourcery.com>

	PR bootstrap/82856
	* Makefile.am: Include multilib.am.

	Merge from binutils-gdb:
	2018-06-19  Simon Marchi  <simon.marchi@ericsson.com>

	* configure.ac: Modernize AC_INIT call, remove AC_PREREQ.
	* Makefile.am (AUTOMAKE_OPTIONS): Remove 1.8, cygnus, add foreign.
	* Makefile.in: Re-generate.
	* aclocal.m4: Re-generate.
	* configure: Re-generate.

From-SVN: r265695
2018-10-31 17:03:16 +00:00
Ian Lance Taylor a2a86641b7 re PR libbacktrace/87529 (libbacktrace API forces users to have memory leaks)
PR libbacktrace/87529
	* backtrace.h: Document that backtrace_create_state should be
	called only once.

From-SVN: r264871
2018-10-05 14:09:07 +00:00
Martin Liska 92a285c1a7 Replace 8 spaces with a tabular in ChangeLog files.
From-SVN: r263886
2018-08-27 14:04:23 +00:00
Iain Buclaw 2206fb8940 libbacktrace: Suppress the default action-if-found for AC_CHECK_LIBS.
Zlib is not a dependency of libbacktrace, and so it shouldn't be added
to LIBS.

libbacktrace/

	* configure.ac: Move define of HAVE_ZLIB into check for -lz.
	* Makefile.in: Regenerate.
	* config.h.in: Likewise.
	* configure: Likewise.

From-SVN: r263320
2018-08-05 20:24:59 +00:00
Tony Reix ca9a1314ec xcoff.c (struct xcoff_line, [...]): Remove.
* xcoff.c (struct xcoff_line, struct xcoff_line_vector): Remove.
	(struct xcoff_func, struct xcoff_func_vector): New structs.
	(xcoff_syminfo): Drop leading dot from symbol name.
	(xcoff_line_compare, xcoff_line_search): Remove.
	(xcoff_func_compare, xcoff_func_search): New static functions.
	(xcoff_lookup_pc): Search function table.
	(xcoff_add_line, xcoff_process_linenos): Remove.
	(xcoff_initialize_fileline): Build function table.

From-SVN: r263238
2018-08-01 21:55:05 +00:00
Denis Khalikov 1ac6620a52 re PR other/86198 (Libbacktrace does not properly work with ".note.gnu.build-id" section)
libbacktrace/

2018-06-21 Denis Khalikov <d.khalikov@partner.samsung.com>

	PR other/86198
	* elf.c (elf_add): Increase ".note.gnu.build-id" section size
	checking up to 36 bytes.

From-SVN: r261832
2018-06-21 08:42:53 +03:00
H.J. Lu 7b47ecf2f7 Regenerate configure of target libraries
* configure: Regenerated.

From-SVN: r259610
2018-04-24 09:45:26 -07:00
Jakub Jelinek a0e1df888d cet.m4 (GCC_CET_FLAGS): Default to --disable-cet, replace --enable-cet=default with --enable-cet=auto.
* config/cet.m4 (GCC_CET_FLAGS): Default to --disable-cet, replace
	--enable-cet=default with --enable-cet=auto.

	* doc/install.texi: Document --disable-cet being the default and
	--enable-cet=auto.

	* configure: Regenerated.

From-SVN: r259487
2018-04-19 09:45:51 +02:00
Ian Lance Taylor 21070494d8 backtrace.c: Revert last two changes.
* backtrace.c: Revert last two changes.  Don't call mmap
	directly.

From-SVN: r259440
2018-04-17 17:58:05 +00:00
Ian Lance Taylor c36af1b4da backtrace.c: Include backtrace-supported.h before checking BACKTRACE_USES_MALLOC.
* backtrace.c: Include backtrace-supported.h before checking
	BACKTRACE_USES_MALLOC.

From-SVN: r259439
2018-04-17 17:29:27 +00:00
Ian Lance Taylor 83a658ca0b backtrace.c (backtrace_full): When testing whether we can allocate memory...
* backtrace.c (backtrace_full): When testing whether we can
	allocate memory, call mmap directly, and munmap the memory.

Fixes https://github.com/ianlancetaylor/libbacktrace/issues/13 .

From-SVN: r259434
2018-04-17 13:59:38 +00:00
Jakub Jelinek c5c4b2ae6e re PR other/85161 (Test case failures in libbacktrace on powerpc64 BE starting with r253456)
PR other/85161
	* elf.c (elf_zlib_fetch): Fix up predefined macro names in test for
	big endian, only use 32-bit loads if endianity macros are predefined
	and indicate big or little endian.

From-SVN: r259096
2018-04-04 19:18:14 +02:00
Igor Tsimbalist 14e335edc8 CET shouldn't be enabled in 32-bit run-time libraries by defualt
ENDBR32 and RDSSPD are multi-byte NOPs on x86-64 processors and
newer x86 processors, starting Pentium Pro.  They are UD on older
32-bit processors. Detect this at configure time and adjust the
default value for enable_cet. GCC will enable CET in 32-bit run-time
libraries in any case if --enable-cet is used to configure GCC.

	PR target/84148
	* config/cet.m4: Check if target support multi-byte NOPS (SSE).
	* libatomic/configure: Regenerate.
	* libbacktrace/configure: Likewise.
	* libgcc/configure: Likewise.
	* libgfortran/configure: Likewise.
	* libgomp/configure: Likewise.
	* libitm/configure: Likewise.
	* libmpx/configure: Likewise.
	* libobjc/configure: Likewise.
	* libquadmath/configure: Likewise.
	* libsanitizer/configure: Likewise.
	* libssp/configure: Likewise.
	* libstdc++-v3/configure: Likewise.
	* libvtv/configure: Likewise.

From-SVN: r257809
2018-02-19 17:25:49 +01:00
Jakub Jelinek bcc23586c5 re PR other/82368 (with r253275 several new test cases in libbacktrace fail)
PR other/82368
	* elf.c (SHT_PROGBITS): Undefine and define.

From-SVN: r257685
2018-02-15 12:32:27 +01:00
Jakub Jelinek da07141fd7 re PR other/82368 (with r253275 several new test cases in libbacktrace fail)
PR other/82368
	* elf.c (EM_PPC64, EF_PPC64_ABI): Undefine and define.
	(struct elf_ppc64_opd_data): New type.
	(elf_initialize_syminfo): Add opd argument, handle symbols
	pointing into the PowerPC64 ELFv1 .opd section.
	(elf_add): Read .opd section on PowerPC64 ELFv1, pass pointer
	to structure with .opd data to elf_initialize_syminfo.

From-SVN: r257658
2018-02-14 15:19:36 +01:00
Ian Lance Taylor 65d0b85990 elf.c (elf_add): Close descriptor if we use a debugfile.
* elf.c (elf_add): Close descriptor if we use a debugfile.
	* btest.c (check_open_files): New static function.
	(main): Call check_open_files.

From-SVN: r257275
2018-01-31 23:23:21 +00:00
Ian Lance Taylor 96f7c2a94a elf.c (elf_open_debugfile_by_debuglink): Don't check CRC if the desired CRC is zero.
* elf.c (elf_open_debugfile_by_debuglink): Don't check CRC if the
	desired CRC is zero.
	(elf_add): Don't clear *found_sym and *found_dwarf if debuginfo.

From-SVN: r257062
2018-01-25 18:14:04 +00:00
Ian Lance Taylor a794e494c6 * pecoff.c (coff_add): Only release syms_view if it is valid.
From-SVN: r257053
2018-01-25 15:38:41 +00:00
Ian Lance Taylor 45f3ab193d * pecoff.c (coff_add): Another memcpy -> coff_read4 fix.
From-SVN: r257052
2018-01-25 15:33:36 +00:00
Ian Lance Taylor 017707ce06 * pecoff.c (coff_add): Use coff_read4, not memcpy.
From-SVN: r257040
2018-01-25 02:42:26 +00:00
Ian Lance Taylor 3fe3c7d749 re PR other/68239 (libbacktrace allocation is sometimes very slow)
PR other/68239
	* mmap.c (backtrace_free_locked): Don't put more than 16 entries
	on the free list.

From-SVN: r257039
2018-01-25 02:24:45 +00:00
Tony Reix 47c699f52a xcoff.c (xcoff_incl_compare): New function.
* xcoff.c (xcoff_incl_compare): New function.
	(xcoff_incl_search): New function.
	(xcoff_process_linenos): Use bsearch to find include file.
	(xcoff_initialize_fileline): Sort include file information.

From-SVN: r256895
2018-01-19 17:45:24 +00:00
Ian Lance Taylor 566588f1a2 elf.c (codes): Fix size to be 288.
* elf.c (codes) [GENERATE_FIXED_HUFFMAN_TABLE]: Fix size to be
	288.
	(main) [GENERATE_FIXED_HUFFMAN_TABLE]: Pass 288 to
	elf_zlib_inflate_table.  Generate elf_zlib_default_dist_table.
	(elf_zlib_default_table): Update.
	(elf_zlib_default_dist_table): New static array.
	(elf_zlib_inflate): Use elf_zlib_default_dist_table for dist table
	for block type 1.
	* ztest.c (struct zlib_test): Add uncompressed_len.
	(tests): Initialize uncompressed_len field.  Add new test case.
	(test_samples): Use uncompressed_len field.

From-SVN: r256776
2018-01-17 01:39:05 +00:00
Jakub Jelinek 85ec4feb11 Update copyright years.
From-SVN: r256169
2018-01-03 11:03:58 +01:00
Igor Tsimbalist 44685d378f Enable building libbacktrace with Intel CET
libbacktrace/
	* configure.ac: Add CET_FLAGS to EXTRA_FLAGS.
	* aclocal.m4: Regenerate.
	* Makefile.in: Likewise.
	* configure: Likewise.

From-SVN: r254892
2017-11-17 22:11:42 +01:00
Ian Lance Taylor 549d24e9f7 ztest.c (test_large): Pass unsigned long *, not size_t *, to zlib uncompress function.
* ztest.c (test_large): Pass unsigned long *, not size_t *, to
	zlib uncompress function.

From-SVN: r253491
2017-10-06 13:37:20 +00:00
Ian Lance Taylor a978e26b83 elf.c (elf_zlib_fetch): Change pval argument to uint64_t *.
* elf.c (elf_zlib_fetch): Change pval argument to uint64_t *.
	Read a four byte integer.
	(elf_zlib_inflate): Change val to uint64_t.  Align pin to a 32-bit
	boundary before ever calling elf_zlib_fetch.
	* ztest.c (test_large): Simplify print statements a bit.

From-SVN: r253456
2017-10-05 16:39:38 +00:00
Ian Lance Taylor 8398c1dfe2 ztest.c: #include <errno.h>.
* ztest.c: #include <errno.h>.
	(TEST_TIMING): Don't define, don't test.
	(xclock_gettime, xclockid_t): Define if !HAVE_CLOCK_GETTIME.
	(clockid_t, clock_gettime, CLOCK_REALTIME): Likewise.
	(ZLIB_CLOCK_GETTIME_ARG): Define.
	* configure.ac: Change clock_gettime_link to CLOCK_GETTIME_LINK.
	* Makefile.am: Likewise.
	* configure, Makefile.in: Rebuild.

From-SVN: r253377
2017-10-03 02:27:33 +00:00
Thomas Schwinge dd954c67ab libbacktrace: Support the case that clock_gettime is in librt
libbacktrace/
	PR other/67165
	* Makefile.am: Append the content of clock_gettime_link to
	ztest_LDADD.
	* configure.ac: Test for the case that clock_gettime is in librt.
	* Makefile.in: Regenerate.
	* configure: Likewise.

From-SVN: r253345
2017-10-02 13:56:39 +02:00
Thomas Schwinge dbc31f20d3 libbacktrace: Conditionalize test timing on clock_gettime availability
libbacktrace/
	PR other/67165
	* configure.ac: Check for clock_gettime.
	* config.h.in: Regenerate.
	* configure: Likewise.
	* ztest.c (average_time, test_large): Conditionalize test timing
	on clock_gettime availability.

From-SVN: r253344
2017-10-02 13:56:25 +02:00
Tony Reix e90c74f598 xcoff.c: Initial support for DWARF debug sections in XCOFF.
* xcoff.c: Initial support for DWARF debug sections in XCOFF.
	(STYP_DWARF, SSUBTYP_DW*): Define.
	(enum dwarf_section): Define.
	(struct dwsect_info): Define.
	(xcoff_add): Look for DWARF sections, pass them to
	backtrace_dwarf_add.

From-SVN: r253297
2017-09-29 16:37:39 +00:00
Ian Lance Taylor 8da872d9ca re PR other/67165 (please enable libbacktrace to work with compressed debug sections)
PR other/67165
	* elf.c (__builtin_prefetch): Define if not __GNUC__.
	(unlikely): Define.
	(SHF_UNCOMPRESSED, ELFCOMPRESS_ZLIB): Define.
	(b_elf_chdr): Define type.
	(enum debug_section): Add ZDEBUG_xxx values.
	(debug_section_names): Add names for new sections.
	(struct debug_section_info): Add compressed field.
	(elf_zlib_failed, elf_zlib_fetch): New static functions.
	(HUFFMAN_TABLE_SIZE, HUFFMAN_VALUE_MASK): Define.
	(HUFFMAN_BITS_SHIFT, HUFFMAN_BITS_MASK): Define.
	(HUFFMAN_SECONDARY_SHIFT): Define.
	(ZDEBUG_TABLE_SIZE): Define.
	(ZDEBUG_TABLE_CODELEN_OFFSET, ZDEBUG_TABLE_WORK_OFFSET): Define.
	(final_next_secondary): New static variable if
	BACKTRACE_GENERATE_FIXED_HUFFMAN_TABLE.
	(elf_zlib_inflate_table): New static function.
	(BACKTRACE_GENERATE_FIXED_HUFFMAN_TABLE): If define, define main
	function to produce fixed Huffman table.
	(elf_zlib_default_table): New static variable.
	(elf_zlib_inflate): New static function.
	(elf_zlib_verify_checksum): Likewise.
	(elf_zlib_inflate_and_verify): Likewise.
	(elf_uncompress_zdebug): Likewise.
	(elf_uncompress_chdr): Likewise.
	(backtrace_uncompress_zdebug): New extern function.
	(elf_add): Look for .zdebug sections and SHF_COMPRESSED debug
	sections, and uncompress them.
	* internal.h (backtrace_compress_zdebug): Declare.
	* ztest.c: New file.
	* configure.ac: Check for -lz and check whether the linker
	supports --compress-debug-sections.
	* Makefile.am (ztest_SOURCES): New variable.
	(ztest_CFLAGS, ztest_LDADD): New variables.
	(check_PROGRAMS): Add ztest.
	(ctestg_SOURCES): New variable.
	(ctestg_CFLAGS, ctestg_LDFLAGS, ctestg_LDADD): New variables.
	(ctesta_SOURCES): New variable.
	(ctesta_CFLAGS, ctesta_LDFLAGS, ctesta_LDADD): New variables.
	(check_PROGRAMS): Add ctestg and ctesta.
	* configure, config.h.in, Makefile.in: Rebuild.

From-SVN: r253275
2017-09-29 00:30:35 +00:00
Ian Lance Taylor 8c2ea6b20a re PR sanitizer/77631 (no symbols in backtrace shown by ASan when debug info is split)
PR sanitizer/77631
	* configure.ac: Check for lstat and readlink.
	* elf.c (lstat, readlink): Provide dummy versions if real versions
	are not available.
	* configure, config.h.in: Rebuild.

From-SVN: r253095
2017-09-22 13:38:10 +00:00
Ian Lance Taylor f0de45420d re PR go/82284 (go -version segfaults on big endian architectures)
PR go/82284
	* elf.c (backtrace_initialize): Set pd.exe_filename.

From-SVN: r253078
2017-09-21 18:44:39 +00:00
Ian Lance Taylor 9283471ba0 re PR sanitizer/77631 (no symbols in backtrace shown by ASan when debug info is split)
PR sanitizer/77631
	Support for external debug info.
	* elf.c: Include <errno.h>, <sys/stat.h>, <unistd.h>.
	(S_ISLNK): Define if not defined.
	(xstrnlen): Define if strnlen is not available.
	(b_elf_note): Define type.
	(NT_GNU_BUILD_ID): Define macro.
	(elf_crc32, elf_crc32_file): New static functions.
	(elf_is_symlink, elf_readlink): New static functions.
	(elf_open_debugfile_by_buildid): New static function.
	(elf_try_debugfile): New static function.
	(elf_find_debugfile_by_debuglink): New static function.
	(elf_open_debugfile_by_debuglink): New static function.
	(elf_add): Add filename and debuginfo parameters.  Adjust all
	callers.  Look for external debug info notes, and try to fetch
	debug info from external file.
	(struct phdr_data): Add exe_filename field.
	(phdr_callback): Pass filename to elf_add.
	(backtrace_initialize): Add filename parameter.
	* internal.h (backtrace_initialize): Add filename parameter.
	* fileline.c (fileline_initialize): Pass filename to
	backtrace_initialize.
	* pecoff.c (fileline_initialize): Add unused filename parameter.
	* unknown.c (fileline_initialize): Likewise.
	* xcoff.c (fileline_initialize): Likewise.
	* configure.ac: Check for objcopy --add-gnu-debuglink.
	* Makefile.am (dtest): New test target.
	* configure, Makefile.in: Rebuild.

Co-Authored-By: Denis Khalikov <d.khalikov@partner.samsung.com>

From-SVN: r253032
2017-09-20 21:09:37 +00:00
Steve Ellcey 29788f9070 re PR other/81096 (test case ttest in libbacktrace fails starting with its introduction in r249111)
2017-09-12  Steve Ellcey  <sellcey@cavium.com>

	PR other/81096
	* Makefile.am (ttest_CFLAGS): Add $(AM_CFLAGS)
	* Makefile.in: Regenerate.

From-SVN: r252038
2017-09-12 17:00:00 +00:00
Steve Ellcey 917a804c61 re PR other/81096 (test case ttest in libbacktrace fails starting with its introduction in r249111)
2017-09-12  Steve Ellcey  <sellcey@cavium.com>

	PR other/81096
	* libbacktrace/Makefile.in
	(HAVE_PTHREAD_TRUE@@NATIVE_TRUE@ttest_CFLAGS): Add $(AM_CFLAGS)

From-SVN: r252035
2017-09-12 16:33:31 +00:00
David Edelsohn 8a0e622411 Add PR number.
From-SVN: r250825
2017-08-02 08:45:55 -04:00
David Edelsohn 2e6af1b892 * xcoff.c (xcoff_process_linenos): Initialize incl to NULL.
From-SVN: r250824
2017-08-02 08:44:54 -04:00
Tony Reix afce7debdc * xcoff.c: Don't leak a file descriptor if an archive is malformed.
From-SVN: r250684
2017-07-28 18:52:13 +00:00
Rainer Orth cf311b0355 Fix pid_t printing
* fileline.c (fileline_initialize): Print pid_t as long.

From-SVN: r250675
2017-07-28 16:26:39 +00:00
Tony Reix 7e2a8417f7 configure.ac: Check for XCOFF32/XCOFF64.
* configure.ac: Check for XCOFF32/XCOFF64.  Check for loadquery.
	* filetype.awk: Separate AIX XCOFF32 and XCOFF64.
	* xcoff.c: Add support for AIX XCOFF32 and XCOFF64 formats.
	* configure, config.h.in: Regenerate.

From-SVN: r250590
2017-07-26 21:43:28 +00:00
Tony Reix b3530b946f filetype.awk: Add AIX XCOFF type detection.
* filetype.awk: Add AIX XCOFF type detection.
	* configure.ac: Recognize xcoff format.
	* Makefile.am (FORMAT_FILES): Add xcoff.c.
	* fileline.c: Include <unistd.h>.
	(fileline_initialize): Add case for AIX procfs.
	* xcoff.c: New file.
	* configure, Makefile.in: Rebuild.

From-SVN: r250435
2017-07-21 18:05:08 +00:00
Richard Biener e91a2ddc1f configure.ac: Add AC_SYS_LARGEFILE.
2017-06-21  Richard Biener  <rguenther@suse.de>

	* configure.ac: Add AC_SYS_LARGEFILE.
	* config.h.in: Regenerate.
	* configure: Likewise.

From-SVN: r249436
2017-06-21 07:04:13 +00:00
Ian Lance Taylor d1609a2326 elf.c (backtrace_initialize): Always set *fileline_fn.
* elf.c (backtrace_initialize): Always set *fileline_fn.
	* ttest.c: New file.
	* btest.c: Move support functions into testlib.c.  Change calls to
	check to pass file name.
	* testlib.c: New file, copied from (part of) btest.c.
	* testlib.h: New file, declarations for testlib.c.
	* edtest.c: Use testlib.h and testlib.c.
	* configure.ac: Test for -pthread, set HAVE_PTHREAD conditional.
	* Makefile.am (btest_SOURCES): Add testlib.c.
	(edtest_SOURCES): Likewise.
	(CHECK_PROGRAMS): Add ttest if HAVE_PTHREAD.
	(ttest_SOURCES, ttest_CFLAGS, ttest_LDADD): Define.
	* configure, Makefile.in: Rebuild.

From-SVN: r249111
2017-06-12 03:25:04 +00:00
Than McIntosh 281161d16b dwarf.c (free_line_header): Don't free dirs if dirs_count == 0.
* dwarf.c (free_line_header): Don't free dirs if dirs_count == 0.
	(read_line_header): Don't allocate dirs if dirs_count == 0.
	* edtest.c: New file.
	* edtest2.c: New file.
	* Makefile.am (edtest_SOURCES, edtest_LDADD): Define.
	(check_PROGRAMS): Add edtest.
	(edtest2_build.c, gen_edtest2_build): New targets.
	* Makefile.in: Rebuild.

From-SVN: r248295
2017-05-19 16:07:24 +00:00
Sam Thursfield 121eb024c8 btest.c (test5): Replace #ifdef guard with 'unused' attribute to fix compile warning when...
* btest.c (test5): Replace #ifdef guard with 'unused' attribute
       to fix compile warning when BACKTRACE_SUPPORTED isn't defined.

From-SVN: r245977
2017-03-08 14:21:21 +00:00
Jakub Jelinek cbe34bb5ed Update copyright years.
From-SVN: r243994
2017-01-01 13:07:43 +01:00
Matthias Klose 84c1b9d3d4 config-ml.in: Remove references to GCJ.
<toplevel>

2016-11-15  Matthias Klose  <doko@ubuntu.com>

	* config-ml.in: Remove references to GCJ.
	* configure.ac: Likewise.
	* configure: Regenerate.

config/

2016-11-15  Matthias Klose  <doko@ubuntu.com>

	multi.m4: Don't set GCJ.

gcc/

2016-11-15  Matthias Klose  <doko@ubuntu.com>

	* doc/install.texi: Remove references to gcj/libjava.
	* doc/invoke.texi: Likewise.

*/ (where necessary)

2016-11-15  Matthias Klose  <doko@ubuntu.com>

	* configure: Regenerate.

From-SVN: r242433
2016-11-15 16:34:02 +00:00
Carlos Liam 84ebf639b8 * all: Remove meaningless trailing whitespace.
From-SVN: r240084
2016-09-11 13:44:07 +00:00
Uros Bizjak 28644f75a9 re PR target/71161 (Lots of ASAN and libgo runtime FAILs after r236090)
PR target/71161
	* elf.c (phdr_callback) [__i386__]: Add
	__attribute__((__force_align_arg_pointer__)).

From-SVN: r236397
2016-05-18 16:40:54 +02:00
Max Ostapenko 26ac52dba5 elf.c (backtrace_initialize): Properly initialize elf_fileline_fn to avoid possible crash.
libbacktrace/

2016-03-02  Maxim Ostapenko  <m.ostapenko@partner.samsung.com>

	* elf.c (backtrace_initialize): Properly initialize elf_fileline_fn to
	avoid possible crash.
	(elf_add): Don't set *fileline_fn to elf_nodebug value in case of
	missing debug info anymore.

From-SVN: r233911
2016-03-02 18:32:55 +02:00
John David Anglin 09b08e17f5 mmap.c (MAP_FAILED): Define if not defined.
* mmap.c (MAP_FAILED): Define if not defined.

From-SVN: r233196
2016-02-06 22:27:34 +00:00
Jakub Jelinek 818ab71a41 Update copyright years.
From-SVN: r232055
2016-01-04 15:30:50 +01:00
Andris Pavenis 5b4bbc7dfb Specify that DJGPP do not have mmap even when sys/mman.h exists
* configure.ac: Specify that DJGPP do not have mmap even when sys/mman.h exists
	* configure: Regenerate

From-SVN: r231802
2015-12-18 06:36:11 +02:00
John David Anglin 2f401a8f18 PR 68115/libfortran
PR 68115/libfortran
	* configure.ac: Set libbacktrace_cv_sys_sync to no on hppa*-*-hpux*.
	* configure: Regenerate.
	* elf.c (backtrace_initialize): Cast __sync_bool_compare_and_swap call
	to void.

From-SVN: r231485
2015-12-10 01:08:13 +00:00
Ian Lance Taylor 750cdaf713 posix.c (backtrace_open): Cast second argument of open() to int.
2015-09-17  Ian Lance Taylor  <iant@google.com>

        * posix.c (backtrace_open): Cast second argument of open() to int.

From-SVN: r227881
2015-09-17 13:08:04 -04:00
Ian Lance Taylor fc00244420 Makefile.am (backtrace.lo): Depend on internal.h.
* Makefile.am (backtrace.lo): Depend on internal.h.
	(sort.lo, stest.lo): Add explicit dependencies.
	* Makefile.in: Rebuild.

From-SVN: r227691
2015-09-11 18:37:31 +00:00
Hans-Peter Nilsson 50809ff975 * backtrace.c: #include <sys/types.h>.
From-SVN: r227568
2015-09-08 23:58:09 +00:00
Ian Lance Taylor c478516be7 re PR other/67457 (segfault in libbacktrace)
PR other/67457
	* backtrace.c: #include "internal.h".
	(struct backtrace_data): Add can_alloc field.
	(unwind): If can_alloc is false, don't try to get file/line
	information.
	(backtrace_full): Set can_alloc field in bdata.
	* alloc.c (backtrace_alloc): Don't call error_callback if it is
	NULL.
	* mmap.c (backtrace_alloc): Likewise.
	* internal.h: Update comments for backtrace_alloc and
	backtrace_free.

From-SVN: r227533
2015-09-08 16:46:16 +00:00
Ian Lance Taylor 981d281fed re PR other/67457 (segfault in libbacktrace)
PR other/67457
	* mmap.c (backtrace_alloc): Correct test for mmap failure.

From-SVN: r227529
2015-09-08 13:49:19 +00:00
Ulrich Weigand 8f5027bf14 configure.ac: For spu-*-* targets, set have_fcntl to no.
* configure.ac: For spu-*-* targets, set have_fcntl to no.
	* configure: Regenerate.

From-SVN: r227348
2015-08-31 14:03:34 +00:00
Ulrich Weigand 7e5c754721 configure.ac: Remove [disable-shared] argument to LT_INIT.
* configure.ac: Remove [disable-shared] argument to LT_INIT.
	Remove setting PIC_FLAG when building as target library.
	* configure: Regenerate.

From-SVN: r227261
2015-08-27 14:08:19 +00:00
Hans-Peter Nilsson 7ce9cf39a4 configure.ac: Only compile with -fPIC if the target supports it.
* configure.ac: Only compile with -fPIC if the target
	supports it.
	* configure: Regenerate.

From-SVN: r227203
2015-08-25 23:32:06 +00:00
Ulrich Weigand 1b533361da configure.ac: Set have_mmap to no on spu-*-* targets.
* configure.ac: Set have_mmap to no on spu-*-* targets.
	* configure: Regenerate.

From-SVN: r227145
2015-08-24 18:48:28 +00:00
Ian Lance Taylor d96fa208a5 dwarf.c (read_function_entry): Add vec_inlined parameter.
* dwarf.c (read_function_entry): Add vec_inlined parameter.
	Change all callers.

From-SVN: r226878
2015-08-13 22:56:01 +00:00
Martin Sebor d99a7b4d6b re PR sanitizer/65479 (sanitizer stack trace missing frames past #0 on powerpc64)
2015-06-11  Martin Sebor  <msebor@redhat.com>

	PR sanitizer/65479
	* dwarf.c (struct line): Add new field idx.
	(line_compare): Use it.
	(add_line): Set it.
	(read_line_info): Reset it.

From-SVN: r224402
2015-06-11 18:01:50 -06:00
Tristan Gingold e24afc10e0 libbacktrace: add support of PE/COFF
libbacktrace/
2015-05-29  Tristan Gingold  <gingold@adacore.com>

	* pecoff.c: New file.
	* Makefile.am (FORMAT_FILES): Add pecoff.c and dependencies.
	* Makefile.in: Regenerate.
	* filetype.awk: Detect pecoff.
	* configure.ac: Define BACKTRACE_SUPPORTS_DATA on elf platforms.
	Add pecoff.
	* btest.c (test5): Test enabled only if BACKTRACE_SUPPORTS_DATA is
	true.
	* backtrace-supported.h.in (BACKTRACE_SUPPORTS_DATA): Define.
	* configure: Regenerate.
	* pecoff.c: New file.

From-SVN: r223859
2015-05-29 08:40:20 +00:00
Michael Haubenwallner df96c0f79a libbacktrace: Bump to automake 1.11.6
2015-05-13  Michael Haubenwallner  <michael.haubenwallner@ssi-schaefer.com>

	* Makefile.in: Regenerated with automake-1.11.6.
	* aclocal.m4: Likewise.
	* configure: Likewise.

From-SVN: r223128
2015-05-13 10:58:11 +00:00
Matthias Klose 2b8fa469eb Move wrong ChangeLog entry from the toplevel ChangeLog to
libbacktrace.

From-SVN: r220112
2015-01-26 14:51:12 +00:00
Matthias Klose 405a6b1c93 configure.ac: Move AM_ENABLE_MULTILIB before AC_PROG_CC.
2015-01-24  Matthias Klose  <doko@ubuntu.com>

        * configure.ac: Move AM_ENABLE_MULTILIB before AC_PROG_CC.
        * configure: Regenerate.

From-SVN: r220075
2015-01-24 02:46:22 +00:00
Jakub Jelinek 5624e564d2 Update copyright years.
From-SVN: r219188
2015-01-05 13:33:28 +01:00
H.J. Lu a699d67255 Always use PIC option with -shared in libtool
Libtool needs to pass PIC option -shared when creating shared object to
link regular object files with slim-lto archive.

	PR bootstrap/63784
	* libtool.m4: Add $pic_flag with -shared.

boehm-gc/

	PR bootstrap/63784
	* configure: Regenerated.

gcc/

	PR bootstrap/63784
	* configure: Regenerated.

libatomic/

	PR bootstrap/63784
	* configure: Regenerated.

libbacktrace/

	PR bootstrap/63784
	* configure: Regenerated.

libcc1/

	PR bootstrap/63784
	* configure: Regenerated.

libcilkrts/

	PR bootstrap/63784
	* configure: Regenerated.

libffi/

	PR bootstrap/63784
	* configure: Regenerated.

libgfortran/

	PR bootstrap/63784
	* configure: Regenerated.

libgomp/

	PR bootstrap/63784
	* configure: Regenerated.

libitm/

	PR bootstrap/63784
	* configure: Regenerated.

libjava/

	PR bootstrap/63784
	* configure: Regenerated.

libjava/classpath/

	PR bootstrap/63784
	* configure: Regenerated.

libobjc/

	PR bootstrap/63784
	* configure: Regenerated.

libquadmath/

	PR bootstrap/63784
	* configure: Regenerated.

libsanitizer/

	PR bootstrap/63784
	* configure: Regenerated.

libssp/

	PR bootstrap/63784
	* configure: Regenerated.

libstdc++-v3/

	PR bootstrap/63784
	* configure: Regenerated.

libvtv/

	PR bootstrap/63784
	* configure: Regenerated.

lto-plugin/

	PR bootstrap/63784
	* configure: Regenerated.

From-SVN: r217937
2014-11-21 08:49:17 -08:00
David Malcolm 35485da996 Merger of dmalcolm/jit branch from git
ChangeLog:
	* ChangeLog.jit: New.
	* MAINTAINERS (Various Maintainers): Add myself as jit maintainer.

contrib/ChangeLog:
	* ChangeLog.jit: New.
	* jit-coverage-report.py: New file: a script to print crude
	code-coverage information for the libgccjit API.

gcc/ChangeLog:
	* ChangeLog.jit: New.
	* Makefile.in (doc_build_sys): New variable, set to "sphinx" if
	sphinx is installed, falling back to "texinfo" otherwise.
	(FULL_DRIVER_NAME): New variable, adapted from the
	install-driver target.  New target, a symlink within the builddir,
	linked to "xgcc", for use when running the JIT library from the
	builddir.
	(MOSTLYCLEANFILES): Add FULL_DRIVER_NAME.
	(install-driver): Use $(FULL_DRIVER_NAME) rather than spelling it
	out.
	* configure.ac (doc_build_sys): New variable, set to "sphinx" if
	sphinx is installed, falling back to "texinfo" otherwise.
	(GCC_DRIVER_NAME): Generate a gcc-driver-name.h file containing
	GCC_DRIVER_NAME for the benefit of jit/internal-api.c.
	* configure: Regenerate.
	* doc/install.texi (--enable-host-shared): Specify that this is
	required when building libgccjit.
	(Tools/packages necessary for modifying GCC): Add Sphinx.
	* timevar.def (TV_JIT_REPLAY): New.
	(TV_ASSEMBLE): New.
	(TV_LINK): New.
	(TV_LOAD): New.

gcc/java/ChangeLog:
	* gcc/ChangeLog.jit: New.

gcc/jit/ChangeLog:
	* ChangeLog.jit: New.
	* ChangeLog: New.
	* Make-lang.in: New.
	* TODO.rst: New.
	* config-lang.in: New.
	* docs/Makefile: New.
	* docs/_build/texinfo/Makefile: New.
	* docs/_build/texinfo/factorial.png: New.
	* docs/_build/texinfo/libgccjit.texi: New.
	* docs/_build/texinfo/sum-of-squares.png: New.
	* docs/conf.py: New.
	* docs/examples/tut01-hello-world.c: New.
	* docs/examples/tut02-square.c: New.
	* docs/examples/tut03-sum-of-squares.c: New.
	* docs/examples/tut04-toyvm/Makefile: New.
	* docs/examples/tut04-toyvm/factorial.toy: New.
	* docs/examples/tut04-toyvm/fibonacci.toy: New.
	* docs/examples/tut04-toyvm/toyvm.c: New.
	* docs/index.rst: New.
	* docs/internals/index.rst: New.
	* docs/intro/factorial.png: New.
	* docs/intro/index.rst: New.
	* docs/intro/sum-of-squares.png: New.
	* docs/intro/tutorial01.rst: New.
	* docs/intro/tutorial02.rst: New.
	* docs/intro/tutorial03.rst: New.
	* docs/intro/tutorial04.rst: New.
	* docs/topics/contexts.rst: New.
	* docs/topics/expressions.rst: New.
	* docs/topics/functions.rst: New.
	* docs/topics/index.rst: New.
	* docs/topics/locations.rst: New.
	* docs/topics/objects.rst: New.
	* docs/topics/results.rst: New.
	* docs/topics/types.rst: New.
	* dummy-frontend.c: New.
	* jit-builtins.c: New.
	* jit-builtins.h: New.
	* jit-common.h: New.
	* jit-playback.c: New.
	* jit-playback.h: New.
	* jit-recording.c: New.
	* jit-recording.h: New.
	* libgccjit++.h: New.
	* libgccjit.c: New.
	* libgccjit.h: New.
	* libgccjit.map: New.
	* notes.txt: New.

gcc/testsuite/ChangeLog:
	* ChangeLog.jit: New.
	* jit.dg/all-non-failing-tests.h: New.
	* jit.dg/harness.h: New.
	* jit.dg/jit.exp: New.
	* jit.dg/test-accessing-struct.c: New.
	* jit.dg/test-accessing-union.c: New.
	* jit.dg/test-array-as-pointer.c: New.
	* jit.dg/test-arrays.c: New.
	* jit.dg/test-calling-external-function.c: New.
	* jit.dg/test-calling-function-ptr.c: New.
	* jit.dg/test-combination.c: New.
	* jit.dg/test-dot-product.c: New.
	* jit.dg/test-empty.c: New.
	* jit.dg/test-error-accessing-field-in-other-struct.c: New.
	* jit.dg/test-error-adding-to-terminated-block.c: New.
	* jit.dg/test-error-array-as-pointer.c: New.
	* jit.dg/test-error-bad-cast.c: New.
	* jit.dg/test-error-block-in-wrong-function.c: New.
	* jit.dg/test-error-call-through-ptr-with-mismatching-args.c: New.
	* jit.dg/test-error-call-through-ptr-with-non-function.c: New.
	* jit.dg/test-error-call-through-ptr-with-non-pointer.c: New.
	* jit.dg/test-error-call-through-ptr-with-not-enough-args.c: New.
	* jit.dg/test-error-call-through-ptr-with-too-many-args.c: New.
	* jit.dg/test-error-call-with-mismatching-args.c: New.
	* jit.dg/test-error-call-with-not-enough-args.c: New.
	* jit.dg/test-error-call-with-too-many-args.c: New.
	* jit.dg/test-error-dereference-field-of-non-pointer.c: New.
	* jit.dg/test-error-dereference-read-of-non-pointer.c: New.
	* jit.dg/test-error-get-type-bad-enum.c: New.
	* jit.dg/test-error-index-not-a-numeric-type.c: New.
	* jit.dg/test-error-mismatching-types-in-assignment.c: New.
	* jit.dg/test-error-mismatching-types-in-call.c: New.
	* jit.dg/test-error-missing-return.c: New.
	* jit.dg/test-error-new-binary-op-bad-op.c: New.
	* jit.dg/test-error-new-function-bad-kind.c: New.
	* jit.dg/test-error-new-unary-op-bad-op.c: New.
	* jit.dg/test-error-null-passed-to-api.c: New.
	* jit.dg/test-error-return-within-void-function.c: New.
	* jit.dg/test-error-unreachable-block.c: New.
	* jit.dg/test-error-unterminated-block.c: New.
	* jit.dg/test-error-value-not-a-numeric-type.c: New.
	* jit.dg/test-expressions.c: New.
	* jit.dg/test-factorial.c: New.
	* jit.dg/test-fibonacci.c: New.
	* jit.dg/test-functions.c: New.
	* jit.dg/test-fuzzer.c: New.
	* jit.dg/test-hello-world.c: New.
	* jit.dg/test-linked-list.c: New.
	* jit.dg/test-long-names.c: New.
	* jit.dg/test-nested-contexts.c: New.
	* jit.dg/test-nested-loops.c: New.
	* jit.dg/test-operator-overloading.cc: New.
	* jit.dg/test-quadratic.c: New.
	* jit.dg/test-quadratic.cc: New.
	* jit.dg/test-reading-struct.c: New.
	* jit.dg/test-string-literal.c: New.
	* jit.dg/test-sum-of-squares.c: New.
	* jit.dg/test-threads.c: New.
	* jit.dg/test-types.c: New.
	* jit.dg/test-using-global.c: New.
	* jit.dg/test-volatile.c: New.

include/ChangeLog:
	* ChangeLog.jit: New.

libbacktrace/ChangeLog:
	* ChangeLog.jit: New.

libcpp/ChangeLog:
	* ChangeLog.jit: New.

libdecnumber/ChangeLog:
	* ChangeLog.jit: New.

libiberty/ChangeLog:
	* ChangeLog.jit: New.

zlib/ChangeLog:
	* ChangeLog.jit: New.

From-SVN: r217374
2014-11-11 21:55:52 +00:00
Francois-Xavier Coudert ebf6d33b73 re PR target/63610 (Fixing the libtool bug for Yosemite (darwin14))
toplevel:
2014-11-11  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>

	PR target/63610
	* libtool.m4: Fix globbing of darwin versions.

boehm-gc/
2014-11-11  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>

	PR target/63610
	* configure: Regenerate.

gcc/
2014-11-11  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>

	PR target/63610
	* configure: Regenerate.

libatomic/
2014-11-11  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>

	PR target/63610
	* configure: Regenerate.

libbacktrace/
2014-11-11  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>

	PR target/63610
	* configure: Regenerate.

libcc1/
2014-11-11  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>

	PR target/63610
	* configure: Regenerate.

libcilkrts/
2014-11-11  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>

	PR target/63610
	* configure: Regenerate.

libffi/
2014-11-11  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>

	PR target/63610
	* configure: Regenerate.

libgfortran/
2014-11-11  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>

	PR target/63610
	* configure: Regenerate.

libgomp/
2014-11-11  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>

	PR target/63610
	* configure: Regenerate.

libitm/
2014-11-11  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>

	PR target/63610
	* configure: Regenerate.

libobjc/
2014-11-11  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>

	PR target/63610
	* configure: Regenerate.

libquadmath/
2014-11-11  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>

	PR target/63610
	* configure: Regenerate.

libsanitizer/
2014-11-11  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>

	PR target/63610
	* configure: Regenerate.

libssp/
2014-11-11  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>

	PR target/63610
	* configure: Regenerate.

libstdc++-v3/
2014-11-11  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>

	PR target/63610
	* configure: Regenerate.

libvtv/
2014-11-11  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>

	PR target/63610
	* configure: Regenerate.

lto-plugin/
2014-11-11  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>

	PR target/63610
	* configure: Regenerate.

libjava/
2014-11-11  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>

	PR target/63610
	* configure: Regenerate.

libjava/classpath/
2014-11-11  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>

	PR target/63610
	* configure: Regenerate.

zlib/
2014-11-11  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>

	PR target/63610
	* configure: Regenerate.

From-SVN: r217366
2014-11-11 20:25:18 +00:00
Ian Lance Taylor c96601d2a7 internal.h (backtrace_atomic_load_pointer): Fix to return void *.
* internal.h (backtrace_atomic_load_pointer) [no atomic or sync]:
	Fix to return void *.

From-SVN: r216603
2014-10-23 22:40:37 +00:00
Ian Lance Taylor d573fd89a5 mmap.c (backtrace_free): If freeing a large aligned block of memory, call munmap rather than holding onto it.
* mmap.c (backtrace_free): If freeing a large aligned block of
	memory, call munmap rather than holding onto it.
	(backtrace_vector_grow): When growing a vector, double the number
	of pages requested.  When releasing the old version of a grown
	vector, pass the correct size to backtrace_free.

From-SVN: r210256
2014-05-09 05:01:08 +00:00
Ian Lance Taylor dbe2084238 * sort.c (backtrace_qsort): Use middle element as pivot.
From-SVN: r208403
2014-03-07 15:52:48 +00:00
Ian Lance Taylor c5604b48f9 sort.c: New file.
* sort.c: New file.
	* stest.c: New file.
	* internal.h (backtrace_qsort): Declare.
	* dwarf.c (read_abbrevs): Call backtrace_qsort instead of qsort.
	(read_line_info, read_function_entry): Likewise.
	(read_function_info, build_dwarf_data): Likewise.
	* elf.c (elf_initialize_syminfo): Likewise.
	* Makefile.am (libbacktrace_la_SOURCES): Add sort.c.
	(stest_SOURCES, stest_LDADD): Define.
	(check_PROGRAMS): Add stest.

From-SVN: r208392
2014-03-07 05:07:56 +00:00
Misty De Meo 63fefb4bc9 re PR libgcc/58710 (HAVE_GETIPINFO is incorrectly set on Mac OS X 10.4)
PR target/58710
	* configure.ac: Use AC_LINK_IFELSE in check for
	_Unwind_GetIPInfo.
	* configure: Regenerate.

From-SVN: r207612
2014-02-07 21:10:55 +00:00
Richard Sandiford afeba5cb1d Update copyright years in libbacktrace/
From-SVN: r206292
2014-01-02 22:24:37 +00:00
Jakub Jelinek 0284b52ec9 elf.c (ET_DYN): Undefine and define again.
* elf.c (ET_DYN): Undefine and define again.
	(elf_add): Add exe argument, if true and ehdr.e_type is ET_DYN,
	return early -1 without closing the descriptor.
	(struct phdr_data): Add exe_descriptor.
	(phdr_callback): If pd->exe_descriptor is not -1, for very first
	call if dlpi_name is NULL just call elf_add with the exe_descriptor,
	otherwise backtrace_close the exe_descriptor if not -1.  Adjust
	call to elf_add.
	(backtrace_initialize): Adjust call to elf_add.  If it returns
	-1, set pd.exe_descriptor to descriptor, otherwise set it to -1.

From-SVN: r205748
2013-12-06 15:48:17 +01:00
Ian Lance Taylor bfd74f227d alloc.c (backtrace_vector_finish): Add error_callback and data parameters.
* alloc.c (backtrace_vector_finish): Add error_callback and data
	parameters.  Call backtrace_vector_release.  Return address base.
	* mmap.c (backtrace_vector_finish): Add error_callback and data
	parameters.  Return address base.
	* dwarf.c (read_function_info): Get new address base from
	backtrace_vector_finish.
	* internal.h (backtrace_vector_finish): Update declaration.

From-SVN: r205716
2013-12-05 18:32:02 +00:00
Ian Lance Taylor b8ddd61b74 dwarf.c (find_address_ranges): New static function, broken out of build_address_map.
* dwarf.c (find_address_ranges): New static function, broken out
	of build_address_map.
	(build_address_map): Call it.
	* btest.c (check): Check for missing filename or function, rather
	than crashing.
	(f3): Check that enough frames were returned.

From-SVN: r205490
2013-11-28 16:19:57 +00:00
Jakub Jelinek 1f96a712d1 backtrace.h (backtrace_syminfo_callback): Add symsize argument.
* backtrace.h (backtrace_syminfo_callback): Add symsize argument.
	* elf.c (elf_syminfo): Pass 0 or sym->size to the callback as
	last argument.
	* btest.c (struct symdata): Add size field.
	(callback_three): Add symsize argument.  Copy it to the data->size
	field.
	(f23): Set symdata.size to 0.
	(test5): Likewise.  If sizeof (int) > 1, lookup address of
	((uintptr_t) &global) + 1.  Verify symdata.val and symdata.size
	values.

From-SVN: r205028
2013-11-19 15:46:03 +01:00
Jakub Jelinek 64856e1e0b * atomic.c: Include sys/types.h.
From-SVN: r205008
2013-11-19 08:43:09 +01:00
Ian Lance Taylor 49579c7e20 configure.ac: Check for support of __atomic extensions.
* configure.ac: Check for support of __atomic extensions.
	* internal.h: Declare or #define atomic functions for use in
	backtrace code.
	* atomic.c: New file.
	* dwarf.c (dwarf_lookup_pc): Use atomic functions.
	(dwarf_fileline, backtrace_dwarf_add): Likewise.
	* elf.c (elf_add_syminfo_data, elf_syminfo): Likewise.
	(backtrace_initialize): Likewise.
	* fileline.c (fileline_initialize): Likewise.
	* Makefile.am (libbacktrace_la_SOURCES): Add atomic.c.
	* configure, config.h.in, Makefile.in: Rebuild.

From-SVN: r204994
2013-11-19 01:09:47 +00:00
Jakub Jelinek f18578157d elf.c (SHN_UNDEF): Define.
* elf.c (SHN_UNDEF): Define.
	(elf_initialize_syminfo): Add base_address argument.  Ignore symbols
	with st_shndx == SHN_UNDEF.  Add base_address to address fields.
	(elf_add): Adjust caller.

From-SVN: r204975
2013-11-18 18:15:07 +01:00
Jakub Jelinek 582f5a2df8 * elf.c (phdr_callback): Process info->dlpi_addr == 0 normally.
From-SVN: r204971
2013-11-18 17:30:44 +01:00
Ian Lance Taylor 25e6253e21 backtrace.h (backtrace_create_state): Correct comment about threading.
* backtrace.h (backtrace_create_state): Correct comment about
	threading.

From-SVN: r204905
2013-11-16 18:27:17 +00:00
Ian Lance Taylor cfa658e4f8 backtrace.h (backtrace_syminfo): Update comment and parameter name to take any address, not just a PC value.
* backtrace.h (backtrace_syminfo): Update comment and parameter
	name to take any address, not just a PC value.
	* elf.c (STT_OBJECT): Define.
	(elf_nosyms): Rename parameter pc to addr.
	(elf_symbol_search): Rename local variable pc to addr.
	(elf_initialize_syminfo): Add STT_OBJECT symbols to elf_symbols.
	(elf_syminfo): Rename parameter pc to addr.
	* btest.c (global): New global variable.
	(test5): New test.
	(main): Call test5.

From-SVN: r204904
2013-11-16 18:20:33 +00:00
Ian Lance Taylor 6c084a5b37 elf.c (elf_add): Don't get the wrong offsets if a debug section is missing.
* elf.c (elf_add): Don't get the wrong offsets if a debug section
	is missing.

From-SVN: r203810
2013-10-18 04:24:48 +00:00
David Malcolm 459260ecf8 Add --enable-host-shared configuration option
/
	* configure.ac: Add --enable-host-shared
	* configure: Regenerate.

gcc/
	* Makefile.in (PICFLAG): New.
	(enable_host_shared): New.
	(INTERNAL_CFLAGS): Use PICFLAG.
	(LIBIBERTY): Use pic build of libiberty.a if configured with
	--enable-host-shared.
	* configure.ac: Add --enable-host-shared, setting up new
	PICFLAG variable.
	* configure: Regenerate.
	* doc/install.texi (--enable-shared): Add note contrasting it
	with...
	(--enable-host-shared): New option.

libbacktrace/
	* configure.ac: Add --enable-host-shared, setting up
	pre-existing PIC_FLAG variable within Makefile.am et al.
	* configure: Regenerate.

libcpp/
	* Makefile.in (PICFLAG): New.
	(ALL_CFLAGS): Add PICFLAG.
	(ALL_CXXFLAGS): Likewise.
	* configure.ac: Add --enable-host-shared, setting up new
	PICFLAG variable.
	* configure: Regenerate.

libdecnumber/
	* Makefile.in (PICFLAG): New.
	(ALL_CFLAGS): Add PICFLAG.
	* configure.ac: Add --enable-host-shared, setting up new
	PICFLAG variable.
	* configure: Regenerate.

libiberty/
	* configure.ac: If --enable-host-shared, use -fPIC.
	* configure: Regenerate.

zlib/
	* configure.ac: Add --enable-host-shared, setting up new
	PICFLAG variable.
	* Makefile.am: Add PICFLAG to libz_a_CFLAGS.
	* Makefile.in: Regenerate.
	* configure: Regenerate.

From-SVN: r203632
2013-10-15 20:33:55 +00:00
Alan Modra 3cbe17f7de libtool.m4 (_LT_ENABLE_LOCK <ld -m flags>): Remove non-canonical ppc host match.
* libtool.m4 (_LT_ENABLE_LOCK <ld -m flags>): Remove non-canonical
	ppc host match.  Support little-endian powerpc linux hosts.
Regenerate configure throughout.

From-SVN: r202773
2013-09-20 19:17:52 +09:30