Commit Graph

270 Commits

Author SHA1 Message Date
Tom de Vries 3f5d2012fb [libbacktrace] Use size_t for low_offset/high_offset fields of struct unit
2019-01-23  Tom de Vries  <tdevries@suse.de>

	* dwarf.c (struct unit): Use size_t for low_offset/high_offset fields.
	(units_search, find_unit): Use size_t for offset.
	(build_address_map): Use size_t for unit_offset.

From-SVN: r268180
2019-01-23 10:22:43 +00:00
Gerald Pfeifer 5e2a724199 * allocfail.c (main): Increase portability of printf statement.
From-SVN: r268105
2019-01-20 15:09:02 +00:00
Ian Lance Taylor 8b248c17bd re PR libbacktrace/88890 (libbacktrace on 32-bit system with _FILE_OFFSET_BITS == 64)
PR libbacktrace/88890
	* mmapio.c (backtrace_get_view): Change size parameter to
	uint64_t.  Check that value fits in size_t.
	* read.c (backtrace_get_view): Likewise.
	* internal.h (backtrace_get_view): Update declaration.
	* elf.c (elf_add): Pass shstrhdr->sh_size to backtrace_get_view.

From-SVN: r268082
2019-01-18 17:13:59 +00:00
Tom de Vries 10f48858e8 [libbacktrace] Add btest_dwz test-case
Add test-case to verify that libbacktrace can read debug info that was
compressed with dwz.

2019-01-17  Tom de Vries  <tdevries@suse.de>

	PR libbacktrace/82857
	* configure.ac (DWZ): Set with AC_CHECK_PROG.
	(HAVE_DWZ): Set with AM_CONDITIONAL.
	* configure: Regenerate.
	* Makefile.am (TESTS): Add btest_dwz.
	* Makefile.in: Regenerate.

From-SVN: r268032
2019-01-17 13:42:30 +00:00
Tom de Vries 1c2a9a37c6 [libbacktrace] Handle DW_FORM_GNU_ref_alt
Handle DW_FORM_GNU_ref_alt which references the .debug_info section in the
.gnu_debugaltlink file.

2019-01-17  Tom de Vries  <tdevries@suse.de>

	PR libbacktrace/82857
	* dwarf.c (enum attr_val_encoding): Add ATTR_VAL_REF_ALT_INFO.
	(read_attribute): Handle DW_FORM_GNU_ref_alt using
	ATTR_VAL_REF_ALT_INFO.
	(read_referenced_name_from_attr): Handle DW_FORM_GNU_ref_alt.

From-SVN: r268031
2019-01-17 13:42:20 +00:00
Tom de Vries 9d576782a2 [libbacktrace] Add find_unit
Add a function that finds the unit given an offset into .debug_info.

2019-01-17  Tom de Vries  <tdevries@suse.de>

	* dwarf.c (struct unit): Add low_offset and high_offset fields.
	(struct unit_vector): New type.
	(struct dwarf_data): Add units and units_counts fields.
	(find_unit): New function.
	(find_address_ranges): Add and handle unit_tag parameter.
	(build_address_map): Add and handle units_vec parameter.
	(build_dwarf_data): Pass units_vec to build_address_map.  Store resulting
	units vector.

From-SVN: r268030
2019-01-17 13:42:09 +00:00
Tom de Vries f2f00d3a04 [libbacktrace] Handle DW_FORM_GNU_strp_alt
Handle DW_FORM_GNU_strp_alt which references the .debug_str section in the
.gnu_debugaltlink file.

2019-01-17  Tom de Vries  <tdevries@suse.de>

	PR libbacktrace/82857
	* dwarf.c (read_attribute): Handle DW_FORM_GNU_strp_alt
	using altlink.

From-SVN: r267996
2019-01-17 00:08:05 +00:00
Tom de Vries 944f59ffe2 [libbacktrace] Handle alt FORMS without .gnu_debugaltlink
Handle DW_FORM_GNU_strp_alt and DW_FORM_GNU_ref_alt references robustly in
presence of missing .gnu_debugaltlink file.

2019-01-17  Tom de Vries  <tdevries@suse.de>

	* dwarf.c (enum attr_val_encoding): Add ATTR_VAL_NONE.
	(read_attribute): Add altlink parameter.  Handle missing altlink for
	DW_FORM_GNU_strp_alt and DW_FORM_GNU_ref_alt.
	(find_address_ranges, build_address_map, build_dwarf_data): Add and
	handle altlink parameter.
	(read_referenced_name, read_function_entry): Add argument to
	read_attribute call.

From-SVN: r267995
2019-01-17 00:07:53 +00:00
Tom de Vries 9ad458d539 [libbacktrace] Add altlink field to struct dwarf_data
Add an altlink field to struct dwarf_data, and initialize it with the pointer
to the struct dwarf_data for the .gnu_debugaltlink.

2019-01-17  Tom de Vries  <tdevries@suse.de>

	* dwarf.c (struct dwarf_data): Add altlink field.
	(backtrace_dwarf_add): Add and handle fileline_altlink parameter.
	* elf.c	(elf_add): Add argument to backtrace_dwarf_add call.
	(phdr_callback, backtrace_initialize): Add argument to elf_add calls.
	* internal.h (backtrace_dwarf_add): Add fileline_altlink parameter.
	* pecoff.c (coff_add): Add argument to backtrace_dwarf_add call.
	* xcoff.c (xcoff_add): Same.

From-SVN: r267994
2019-01-17 00:07:43 +00:00
Tom de Vries e6f00c83f4 [libbacktrace] Return struct dwarf_data pointer from elf_add
Allow the caller of elf_add access to the struct dwarf_data pointer
corresponding to the added elf.

2019-01-17  Tom de Vries  <tdevries@suse.de>

	* internal.h (backtrace_dwarf_add): Add fileline_entry parameter.
	* dwarf.c (backtrace_dwarf_add): Add and handle fileline_entry parameter.
	* elf.c	(elf_add): Add and handle fileline_entry parameter.  Add
	argument to backtrace_dwarf_add call.
	(phdr_callback, backtrace_initialize): Add argument to elf_add calls.
	* pecoff.c (coff_add): Add argument to backtrace_dwarf_add call.
	* xcoff.c (xcoff_add): Same.

From-SVN: r267993
2019-01-17 00:07:32 +00:00
Tom de Vries a34c2a3d19 [libbacktrace] Read .gnu_debugaltlink
Read the elf file pointed at by the .gnu_debugaltlink section, and verify that
the build id matches.

2019-01-17  Tom de Vries  <tdevries@suse.de>

	* elf.c (elf_add): Add and handle with_buildid_data and
	with_buildid_size parameters.  Handle .gnu_debugaltlink section.
	(phdr_callback, backtrace_initialize): Add arguments to elf_add calls.

From-SVN: r267992
2019-01-17 00:07:21 +00:00
Tom de Vries 07e1534f44 [libbacktrace] Factor out read_referenced_name_from_attr
Factor out the common handling of DW_AT_abstract_origin and
DW_AT_specification from read_function_entry and read_referenced_name.

2019-01-16  Tom de Vries  <tdevries@suse.de>

	* dwarf.c (read_referenced_name_from_attr): New function.  Factor out
	of ...
 	(read_referenced_name): ... here, and ...
	(read_function_entry): ... here.

From-SVN: r267986
2019-01-16 20:47:02 +00:00
Tom de Vries df1de06415 [libbacktrace] Unify function name preference handling
Both read_function_entry and read_referenced_name implement a priority scheme
for names.  The priorities are:
- 1st: DW_AT_linkage_name
- 2nd: Name from DW_AT_abstract_origin or DW_AT_specification
- 3rd: DW_AT_name.

Ensure both functions fully adhere to it.

2019-01-16  Tom de Vries  <tdevries@suse.de>

	* dwarf.c (read_referenced_name): Don't allow DW_AT_name to override any
	name.
	(read_function_entry): Same.  Don't allow name found via
	DW_AT_abstract_origin or case DW_AT_specification to override linkage
	name.

From-SVN: r267963
2019-01-16 07:46:56 +00:00
Sandra Loosemore 6791469314 PR other/16615 [1/5]
2019-01-09  Sandra Loosemore  <sandra@codesourcery.com>

	PR other/16615 [1/5]

	contrib/
	* mklog: Mechanically replace "can not" with "cannot".

	gcc/
	* Makefile.in: Mechanically replace "can not" with "cannot".
	* alias.c: Likewise.
	* builtins.c: Likewise.
	* calls.c: Likewise.
	* cgraph.c: Likewise.
	* cgraph.h: Likewise.
	* cgraphclones.c: Likewise.
	* cgraphunit.c: Likewise.
	* combine-stack-adj.c: Likewise.
	* combine.c: Likewise.
	* common/config/i386/i386-common.c: Likewise.
	* config/aarch64/aarch64.c: Likewise.
	* config/alpha/sync.md: Likewise.
	* config/arc/arc.c: Likewise.
	* config/arc/predicates.md: Likewise.
	* config/arm/arm-c.c: Likewise.
	* config/arm/arm.c: Likewise.
	* config/arm/arm.h: Likewise.
	* config/arm/arm.md: Likewise.
	* config/arm/cortex-r4f.md: Likewise.
	* config/csky/csky.c: Likewise.
	* config/csky/csky.h: Likewise.
	* config/darwin-f.c: Likewise.
	* config/epiphany/epiphany.md: Likewise.
	* config/i386/i386.c: Likewise.
	* config/i386/sol2.h: Likewise.
	* config/m68k/m68k.c: Likewise.
	* config/mcore/mcore.h: Likewise.
	* config/microblaze/microblaze.md: Likewise.
	* config/mips/20kc.md: Likewise.
	* config/mips/sb1.md: Likewise.
	* config/nds32/nds32.c: Likewise.
	* config/nds32/predicates.md: Likewise.
	* config/pa/pa.c: Likewise.
	* config/rs6000/e300c2c3.md: Likewise.
	* config/rs6000/rs6000.c: Likewise.
	* config/s390/s390.h: Likewise.
	* config/sh/sh.c: Likewise.
	* config/sh/sh.md: Likewise.
	* config/spu/vmx2spu.h: Likewise.
	* cprop.c: Likewise.
	* dbxout.c: Likewise.
	* df-scan.c: Likewise.
	* doc/cfg.texi: Likewise.
	* doc/extend.texi: Likewise.
	* doc/fragments.texi: Likewise.
	* doc/gty.texi: Likewise.
	* doc/invoke.texi: Likewise.
	* doc/lto.texi: Likewise.
	* doc/md.texi: Likewise.
	* doc/objc.texi: Likewise.
	* doc/rtl.texi: Likewise.
	* doc/tm.texi: Likewise.
	* dse.c: Likewise.
	* emit-rtl.c: Likewise.
	* emit-rtl.h: Likewise.
	* except.c: Likewise.
	* expmed.c: Likewise.
	* expr.c: Likewise.
	* fold-const.c: Likewise.
	* genautomata.c: Likewise.
	* gimple-fold.c: Likewise.
	* hard-reg-set.h: Likewise.
	* ifcvt.c: Likewise.
	* ipa-comdats.c: Likewise.
	* ipa-cp.c: Likewise.
	* ipa-devirt.c: Likewise.
	* ipa-fnsummary.c: Likewise.
	* ipa-icf.c: Likewise.
	* ipa-inline-transform.c: Likewise.
	* ipa-inline.c: Likewise.
	* ipa-polymorphic-call.c: Likewise.
	* ipa-profile.c: Likewise.
	* ipa-prop.c: Likewise.
	* ipa-pure-const.c: Likewise.
	* ipa-reference.c: Likewise.
	* ipa-split.c: Likewise.
	* ipa-visibility.c: Likewise.
	* ipa.c: Likewise.
	* ira-build.c: Likewise.
	* ira-color.c: Likewise.
	* ira-conflicts.c: Likewise.
	* ira-costs.c: Likewise.
	* ira-int.h: Likewise.
	* ira-lives.c: Likewise.
	* ira.c: Likewise.
	* ira.h: Likewise.
	* loop-invariant.c: Likewise.
	* loop-unroll.c: Likewise.
	* lower-subreg.c: Likewise.
	* lra-assigns.c: Likewise.
	* lra-constraints.c: Likewise.
	* lra-eliminations.c: Likewise.
	* lra-lives.c: Likewise.
	* lra-remat.c: Likewise.
	* lra-spills.c: Likewise.
	* lra.c: Likewise.
	* lto-cgraph.c: Likewise.
	* lto-streamer-out.c: Likewise.
	* postreload-gcse.c: Likewise.
	* predict.c: Likewise.
	* profile-count.h: Likewise.
	* profile.c: Likewise.
	* recog.c: Likewise.
	* ree.c: Likewise.
	* reload.c: Likewise.
	* reload1.c: Likewise.
	* reorg.c: Likewise.
	* resource.c: Likewise.
	* rtl.def: Likewise.
	* rtl.h: Likewise.
	* rtlanal.c: Likewise.
	* sched-deps.c: Likewise.
	* sched-ebb.c: Likewise.
	* sched-rgn.c: Likewise.
	* sel-sched-ir.c: Likewise.
	* sel-sched.c: Likewise.
	* shrink-wrap.c: Likewise.
	* simplify-rtx.c: Likewise.
	* symtab.c: Likewise.
	* target.def: Likewise.
	* toplev.c: Likewise.
	* tree-call-cdce.c: Likewise.
	* tree-cfg.c: Likewise.
	* tree-complex.c: Likewise.
	* tree-core.h: Likewise.
	* tree-eh.c: Likewise.
	* tree-inline.c: Likewise.
	* tree-loop-distribution.c: Likewise.
	* tree-nrv.c: Likewise.
	* tree-profile.c: Likewise.
	* tree-sra.c: Likewise.
	* tree-ssa-alias.c: Likewise.
	* tree-ssa-dce.c: Likewise.
	* tree-ssa-dom.c: Likewise.
	* tree-ssa-forwprop.c: Likewise.
	* tree-ssa-loop-im.c: Likewise.
	* tree-ssa-loop-ivcanon.c: Likewise.
	* tree-ssa-loop-ivopts.c: Likewise.
	* tree-ssa-loop-niter.c: Likewise.
	* tree-ssa-phionlycprop.c: Likewise.
	* tree-ssa-phiopt.c: Likewise.
	* tree-ssa-propagate.c: Likewise.
	* tree-ssa-threadedge.c: Likewise.
	* tree-ssa-threadupdate.c: Likewise.
	* tree-ssa-uninit.c: Likewise.
	* tree-ssanames.c: Likewise.
	* tree-streamer-out.c: Likewise.
	* tree.c: Likewise.
	* tree.h: Likewise.
	* vr-values.c: Likewise.

	gcc/ada/
	* exp_ch9.adb: Mechanically replace "can not" with "cannot".
	* libgnat/s-regpat.ads: Likewise.
	* par-ch4.adb: Likewise.
	* set_targ.adb: Likewise.
	* types.ads: Likewise.

	gcc/cp/
	* cp-tree.h: Mechanically replace "can not" with "cannot".
	* parser.c: Likewise.
	* pt.c: Likewise.

	gcc/fortran/
	* class.c: Mechanically replace "can not" with "cannot".
	* decl.c: Likewise.
	* expr.c: Likewise.
	* gfc-internals.texi: Likewise.
	* intrinsic.texi: Likewise.
	* invoke.texi: Likewise.
	* io.c: Likewise.
	* match.c: Likewise.
	* parse.c: Likewise.
	* primary.c: Likewise.
	* resolve.c: Likewise.
	* symbol.c: Likewise.
	* trans-array.c: Likewise.
	* trans-decl.c: Likewise.
	* trans-intrinsic.c: Likewise.
	* trans-stmt.c: Likewise.

	gcc/go/
	* go-backend.c: Mechanically replace "can not" with "cannot".
	* go-gcc.cc: Likewise.

	gcc/lto/
	* lto-partition.c: Mechanically replace "can not" with "cannot".
	* lto-symtab.c: Likewise.
	* lto.c: Likewise.

	gcc/objc/
	* objc-act.c: Mechanically replace "can not" with "cannot".

	libbacktrace/
	* backtrace.h: Mechanically replace "can not" with "cannot".

	libgcc/
	* config/c6x/libunwind.S: Mechanically replace "can not" with
	"cannot".
	* config/tilepro/atomic.h: Likewise.
	* config/vxlib-tls.c: Likewise.
	* generic-morestack-thread.c: Likewise.
	* generic-morestack.c: Likewise.
	* mkmap-symver.awk: Likewise.

	libgfortran/
	* caf/single.c: Mechanically replace "can not" with "cannot".
	* io/unit.c: Likewise.

	libobjc/
	* class.c: Mechanically replace "can not" with "cannot".
	* objc/runtime.h: Likewise.
	* sendmsg.c: Likewise.

	liboffloadmic/
	* include/coi/common/COIResult_common.h: Mechanically replace
	"can not" with "cannot".
	* include/coi/source/COIBuffer_source.h: Likewise.

	libstdc++-v3/
	* include/ext/bitmap_allocator.h: Mechanically replace "can not"
	with "cannot".

From-SVN: r267783
2019-01-09 16:37:45 -05:00
Jakub Jelinek a554497024 Update copyright years.
From-SVN: r267494
2019-01-01 13:31:55 +01:00
Gerald Pfeifer 4b420b27d3 Makefile.am (xcoff_%.c): Use an actual newline instead of \n in sed pattern.
* Makefile.am (xcoff_%.c): Use an actual newline instead of \n
	in sed pattern.
	* Makefile.in: Regenerate.

From-SVN: r267470
2018-12-29 23:22:50 +00:00
Tom de Vries eb33bf0a0a [libbacktrace] Reduce memory usage in build_address_map
In build_address_map we allocate a unit, and then look for addresses in the
unit, which we store in the addrs vector, with the elements pointing to the
unit.  However, if we cannot find addresses in the unit, the allocated unit is
not used.

Fix this by detecting if the allocated unit has been used, and reusing it
otherwise.

Bootstrapped and reg-tested on x86_64.

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

	* dwarf.c (build_address_map): Reuse unused units.

From-SVN: r267445
2018-12-28 03:43:56 +00:00
Tom de Vries d9aa0961ea [libbacktrace] Simplify memory management in build_address_map
In the main loop in build_address_map, we first read the abbrevs into a local
variable abbrevs, and then allocate the corresponding unit, after which we assign
the abbrevs to the unit.  This results in dedicated free-upon-failure
handling for the variable, and extra code to make sure that free-upon-failure
doesn't trigger once the unit has taken ownership of the abbrevs.

Simplify this by reversing the order of abbrev reading and unit allocation,
and eliminating the abbrevs local variable.

Bootstrapped and reg-tested on x86_64.

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

	* dwarf.c (build_address_map): Simplify by removing local variable
	abbrevs.

From-SVN: r267444
2018-12-28 03:43:41 +00:00
Ian Lance Taylor 40b8d3b253 [libbacktrace] Fix memory leak in loop in build_address_map
When failing in build_address_map, we free the unit that's currently being
handled in the loop, but the ones that already have been allocated are leaked.

Fix this by keeping track of allocated units in a vector, and releasing them
upon failure.

Also, now that we have a vector of allocated units, move the freeing upon
failure of the abbrevs associated with each unit to build_address_map, and
remove the now redundant call to free_unit_addrs_vector.

Bootstrapped and reg-tested on x86_64.

2018-12-28  Ian Lance Taylor  <iant@golang.org>
	    Tom de Vries  <tdevries@suse.de>

	PR libbacktrace/88063
	* dwarf.c (free_unit_addrs_vector): Remove.
	(build_address_map): Keep track of allocated units in vector.  Free
	allocated units and corresponding abbrevs upon failure.  Remove now
	redundant call to free_unit_addrs_vector.  Free addrs vector upon
	failure.  Free allocated unit vector.

Co-Authored-By: Tom de Vries <tdevries@suse.de>

From-SVN: r267443
2018-12-28 03:43:26 +00:00
Tom de Vries 53a52133a5 [libbacktrace] Fix memory leak in build_address_map
While upon failure in build_address_map we call free_unit_addrs_vector, this
does not actually free the addrs vector, but merely the abbrevs of the units
pointed at by the elements of the addrs vector.

Fix this by adding code to build_address_map to make sure that the addrs vector
is freed upon failure.

Bootstrapped and reg-tested on x86_64.

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

	* dwarf.c (build_address_map): Free addrs vector upon failure.

From-SVN: r267442
2018-12-28 03:43:15 +00:00
Tom de Vries a37a52e592 [testsuite] Remove bashism from libbacktrace/allocfail.sh
Test-case libbacktrace/allocfail.sh contains bashism "set -o pipefail", which
makes the script fail on ubuntu 18.04, which links /bin/sh to /bin/dash.

Fix this by removing the "set -o pipefail".

Tested by running the test-case with dash on x86_64-linux.

2018-12-14  Tom de Vries  <tdevries@suse.de>

	PR testsuite/88491
	* allocfail.sh: Remove "set -o pipefail".

From-SVN: r267127
2018-12-14 09:43:41 +00:00
Tom de Vries d665cd9b13 [libbacktrace] Add allocfail.sh test-case
Add test-case that forces alloc.c functions to fail, and check whether fail
handling is robust.

This is the test-case for "[libbacktrace] Fix segfault upon allocation
failure".  Without that patch, this test-case fails like this:
...
allocfail.sh: line 71: 26041 Segmentation fault      (core dumped) \
  ./allocfail $i > /dev/null 2>&1
Unallowed fail found: 13
FAIL allocfail.sh (exit status: 1)
...

This is a seperate patch because the test-case is nontrivial.

Bootstrapped and reg-tested on x86_64.

2018-12-12  Tom de Vries  <tdevries@suse.de>

	* Makefile.am (TESTS): Add allocfail.sh.
	(check_PROGRAMS): Add allocfail.
	* Makefile.in: Regenerate.
	* instrumented_alloc.c: New file.  Redefine malloc and realloc.
	Include alloc.c.
	* allocfail.c: New file.
	* allocfail.sh: New file.

From-SVN: r267054
2018-12-12 13:50:51 +00:00
Tom de Vries 187b9e1dc5 [libbacktrace] Add tests for unused formats
When building libbacktrace, we typically use elf.c, and don't build pecoff.c,
xcoff.c or unknown.c.

Add testcases that use unused format to ensure that we also build and
test those on a typical development setup.

Bootstrapped and reg-tested on x86_64.

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

	* Makefile.am (check_PROGRAMS): Add test_elf, test_xcoff_32,
	test_xcoff_64, test_pecoff and test_unknown.
	* Makefile.in: Regenerate.
	* test_format.c: New file.

From-SVN: r266668
2018-11-30 15:33:23 +00:00
Tom de Vries 9b7d1a9741 [libbacktrace] Test check_PROGRAMS without mmap
When building libbacktrace, we typically use mmapio.c and mmap.c, and don't
build read.c and alloc.c.

Add testcases that use read.c and alloc.c to ensure that we also build and
test those on a typical development setup.

Bootstrapped and reg-tested on x86_64.

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

	* Makefile.am : Add _with_alloc version for each test in
	check_PROGRAMS.
	* Makefile.in: Regenerate.

From-SVN: r266667
2018-11-30 15:33:12 +00:00
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
Alexander Monakov 78625ce608 elf.c (elf_syminfo): Loop over the elf_syminfo_data chain.
* elf.c (elf_syminfo): Loop over the elf_syminfo_data chain.

From-SVN: r201159
2013-07-23 13:17:10 +04:00
Alexander Monakov 0153887c3d elf.c (backtrace_initialize): Pass elf_fileline_fn to dl_iterate_phdr callbacks.
* elf.c (backtrace_initialize): Pass elf_fileline_fn to
	dl_iterate_phdr callbacks.

From-SVN: r201158
2013-07-23 13:12:00 +04:00
Ian Lance Taylor 85d8c21edb alloc.c: #include <sys/types.h>.
* alloc.c: #include <sys/types.h>.
	* mmap.c: Likewise.

From-SVN: r197057
2013-03-25 18:13:18 +00:00
Ian Lance Taylor 38811401ad dwarf.c (read_function_info): Permit fvec parameter to be NULL.
* dwarf.c (read_function_info): Permit fvec parameter to be NULL.
	(dwarf_lookup_pc): Don't use ddata->fvec if threaded.

From-SVN: r195620
2013-01-31 17:50:47 +00:00
Jakub Jelinek 1e678aed6c re PR other/56076 (Several 64-bit libgo tests FAIL in read_line_header)
PR other/56076
	* dwarf.c (read_line_header): Don't crash if DW_AT_comp_dir
	attribute was not seen.

From-SVN: r195478
2013-01-25 22:36:11 +00:00
Ian Lance Taylor 6b514c5361 dwarf.c (struct unit): Add filename and abs_filename fields.
* dwarf.c (struct unit): Add filename and abs_filename fields.
	(build_address_map): Set new fields when reading unit.
	(dwarf_lookup_pc): If we don't find an entry in the line table,
	just return the main file name.

From-SVN: r195257
2013-01-17 01:20:28 +00:00
Richard Sandiford f8a7e1a44d Update copyright years in libbacktrace.
From-SVN: r195165
2013-01-14 18:17:30 +00:00
Ian Lance Taylor c3de196091 re PR bootstrap/54834 (bootstrap fails when building libbacktrace)
PR bootstrap/54834
	* Makefile.am (AM_CPPFLAGS): Remove -I ../gcc/include and -I
	$(MULTIBUILDTOP)/../../gcc/include.
	* Makefile.in: Rebuild.

From-SVN: r194770
2013-01-01 16:23:03 +00:00
Ian Lance Taylor 2a5195d965 re PR other/55536 (libbacktrace abort in backtrace_alloc at mmap.c:99 running btest)
PR other/55536
	* mmap.c (backtrace_alloc): Don't call sync functions if not
	threaded.
	(backtrace_free): Likewise.

From-SVN: r194768
2013-01-01 16:13:20 +00:00
John David Anglin 85619b6fc1 mmapio.c: Define MAP_FAILED if not defined.
* mmapio.c: Define MAP_FAILED if not defined.

From-SVN: r194443
2012-12-12 13:06:53 +00:00
Jakub Jelinek 36a58fb342 re PR bootstrap/54926 (Bootstrap comparison failure for various files in libbacktrace)
PR bootstrap/54926
	* Makefile.am (AM_CFLAGS): Remove -frandom-seed=$@.
	* configure.ac: If --with-target-subdir, add -frandom-seed=$@
	to EXTRA_FLAGS unconditionally, otherwise check whether the compiler
	accepts it.
	* Makefile.in: Regenerated.
	* configure: Regenerated.

From-SVN: r194412
2012-12-11 19:45:45 +01:00
Jakub Jelinek a58dfde08d re PR bootstrap/54926 (Bootstrap comparison failure for various files in libbacktrace)
PR bootstrap/54926
	* Makefile.am (AM_CFLAGS): Add -frandom-seed=$@.
	* Makefile.in: Regenerated.

From-SVN: r194303
2012-12-07 15:14:25 +01:00
Ian Lance Taylor b20ade36e4 * dwarf.c (read_attribute): Always clear val.
From-SVN: r193670
2012-11-20 17:28:05 +00:00
Ian Lance Taylor 73c3ed27fc re PR other/55312 (libbacktrace doesn't honor --disable-werror)
PR other/55312
	* configure.ac: Only add -Werror if building a target library.

From-SVN: r193485
2012-11-13 21:25:39 +00:00
Ian Lance Taylor 33521509a8 configure.ac: Check for getexecname.
* configure.ac: Check for getexecname.
	* fileline.c: #include <errno.h>.  Define getexecname if not
	available.
	(fileline_initialize): Try to find the executable in a few
	different ways.
	* print.c (error_callback): Only print the filename if it came
	from the backtrace state.
	* configure, config.h.in: Rebuild.

Co-Authored-By: Gerald Pfeifer <gerald@pfeifer.com>
Co-Authored-By: Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>

From-SVN: r193454
2012-11-12 21:24:19 +00:00
Ian Lance Taylor 8fe91dea4f mmap.c (backtrace_vector_release): Correct last patch: add aligned, not size.
* mmap.c (backtrace_vector_release): Correct last patch: add
	aligned, not size.

From-SVN: r192956
2012-10-29 18:42:05 +00:00
Ian Lance Taylor 8277de3441 mmap.c (backtrace_vector_release): Make sure freed block is aligned on 8-byte boundary.
* mmap.c (backtrace_vector_release): Make sure freed block is
	aligned on 8-byte boundary.

From-SVN: r192945
2012-10-29 15:43:37 +00:00
Ian Lance Taylor 73f4149137 re PR other/55087 (bogus "linux-vdso.so.1: No such file or directory" caused by libbacktrace)
PR other/55087
	* posix.c (backtrace_open): Add does_not_exist parameter.
	* elf.c (phdr_callback): Do not warn if shared library could not
	be opened.
	* fileline.c (fileline_initialize): Update calls to
	backtrace_open.
	* internal.h (backtrace_open): Update declaration.

From-SVN: r192861
2012-10-26 20:08:29 +00:00
Jack Howarth 385710cf27 re PR target/55061 (libbacktrace build fails during bootstrap on powerpc-apple-darwin9)
PR target/55061
	* configure.ac: Check for _Unwind_GetIPInfo function declaration.
	* configure: Regenerate.

From-SVN: r192853
2012-10-26 17:34:59 +00:00
Ian Lance Taylor 32061319f7 re PR target/55061 (libbacktrace build fails during bootstrap on powerpc-apple-darwin9)
PR target/55061
	* configure.ac: Check whether -funwind-tables option works.
	* configure: Rebuild.

From-SVN: r192782
2012-10-24 21:09:55 +00:00
Ian Lance Taylor 5551b12c31 configure.ac: Do not use dl_iterate_phdr on Solaris 10.
* configure.ac: Do not use dl_iterate_phdr on Solaris 10.
	* configure: Rebuild.

From-SVN: r192371
2012-10-11 16:43:47 +00:00
Ian Lance Taylor 40d15b5bdc elf.c: Rename all Elf typedefs to start with b_elf, and be all lower case.
* elf.c: Rename all Elf typedefs to start with b_elf, and be all
	lower case.

From-SVN: r192331
2012-10-10 19:59:00 +00:00
Hans-Peter Nilsson 74f8062044 * elf.c (elf_add_syminfo_data): Add casts to avoid warning.
From-SVN: r192311
2012-10-10 12:55:52 +00:00
Ian Lance Taylor ce8aa07436 dwarf.c (dwarf_fileline): Add cast to avoid warning.
* dwarf.c (dwarf_fileline): Add cast to avoid warning.
	(backtrace_dwarf_add): Likewise.

From-SVN: r192288
2012-10-10 04:37:06 +00:00
Ian Lance Taylor e561a9920c Add support for tracing through shared libraries.
* configure.ac: Check for link.h and dl_iterate_phdr.
	* elf.c: #include <link.h> if system has dl_iterate_phdr.  #undef
	ELF macros before #defining them.
	(dl_phdr_info, dl_iterate_phdr): Define if system does not have
	dl_iterate_phdr.
	(struct elf_syminfo_data): Add next field.
	(elf_initialize_syminfo): Initialize next field.
	(elf_add_syminfo_data): New static function.
	(elf_add): New static function, broken out of
	backtrace_initialize.  Call backtrace_dwarf_add instead of
	backtrace_dwarf_initialize.
	(struct phdr_data): Define.
	(phdr_callback): New static function.
	(backtrace_initialize): Call elf_add.
	* dwarf.c (struct dwarf_data): Add next and base_address fields.
	(add_unit_addr): Add base_address parameter.  Change all callers.
	(add_unit_ranges, build_address_map): Likewise.
	(add_line): Add ddata parameter.  Change all callers.
	(read_line_program, add_function_range): Likewise.
	(dwarf_lookup_pc): New static function, broken out of
	dwarf_fileline.
	(dwarf_fileline): Call dwarf_lookup_pc.
	(build_dwarf_data): New static function.
	(backtrace_dwarf_add): New function.
	(backtrace_dwarf_initialize): Remove.
	* internal.h (backtrace_dwarf_initialize): Don't declare.
	(backtrace_dwarf_add): Declare.
	* configure, config.h.in: Rebuild.

From-SVN: r192267
2012-10-09 18:20:45 +00:00
Gerald Pfeifer 068ef6d10d * btest.c (f23): Avoid uninitialized variable warning.
From-SVN: r192102
2012-10-04 20:16:08 +00:00