]> sourceware.org Git - dwz.git/log
dwz.git
12 years agoRemove .debug_pubnames and/or .debug_pubtypes section, instead of
Jakub Jelinek [Wed, 6 Jun 2012 06:36:24 +0000 (08:36 +0200)]
Remove .debug_pubnames and/or .debug_pubtypes section, instead of
aborting compression when they are seen.

12 years agoAdd lots of comments.
Jakub Jelinek [Tue, 5 Jun 2012 15:15:41 +0000 (17:15 +0200)]
Add lots of comments.
Replace struct dw_cu * with a new dw_cu_ref typedef.

12 years agoSwitch to gcc's dwarf{2.def,2.h,names.c} triplet from older dwarf2.h.
Jakub Jelinek [Tue, 5 Jun 2012 09:51:07 +0000 (11:51 +0200)]
Switch to gcc's dwarf{2.def,2.h,names.c} triplet from older dwarf2.h.
Use get_DW_*_name to print form/attribute/op names where possible.

12 years agoAdd -M and -r options.
Jakub Jelinek [Mon, 4 Jun 2012 14:04:48 +0000 (16:04 +0200)]
Add -M and -r options.

12 years agoHandle properly with -m the case when all of .debug_str is moved into the
Jakub Jelinek [Fri, 1 Jun 2012 09:13:15 +0000 (11:13 +0200)]
Handle properly with -m the case when all of .debug_str is moved into the
alternate file.

12 years agoFix up .gdb_index rewriting if .debug_types section is not present.
Jakub Jelinek [Thu, 31 May 2012 17:32:53 +0000 (19:32 +0200)]
Fix up .gdb_index rewriting if .debug_types section is not present.

12 years agoFix up TU signature store for big-endian.
Jakub Jelinek [Wed, 30 May 2012 17:16:42 +0000 (19:16 +0200)]
Fix up TU signature store for big-endian.

12 years agoFix up .gdb_index adjusting if .debug_types section is present.
Jakub Jelinek [Wed, 30 May 2012 16:56:45 +0000 (18:56 +0200)]
Fix up .gdb_index adjusting if .debug_types section is present.

12 years agoImplement special low_mem mode, which roughly halves amount of
Jakub Jelinek [Tue, 29 May 2012 17:00:58 +0000 (19:00 +0200)]
Implement special low_mem mode, which roughly halves amount of
needed RAM at the expense of small slowdown on very large
inputs (more than -l COUNT DIEs).  Give up if input has more than
-L COUNT DIEs.

12 years agoHandle ref->die_collapsed_child in mark_refs.
Jakub Jelinek [Thu, 24 May 2012 16:45:32 +0000 (18:45 +0200)]
Handle ref->die_collapsed_child in mark_refs.

12 years agoHandle the case where multi_line_off and/or multi_str_off is 0
Jakub Jelinek [Thu, 24 May 2012 10:23:54 +0000 (12:23 +0200)]
Handle the case where multi_line_off and/or multi_str_off is 0
at the start of optimize_multifile.

12 years agoFree resa array.
Jakub Jelinek [Wed, 23 May 2012 17:48:28 +0000 (19:48 +0200)]
Free resa array.

12 years agoAdd -h option to handle hardlinks properly. Don't process files with
Jakub Jelinek [Wed, 23 May 2012 17:46:39 +0000 (19:46 +0200)]
Add -h option to handle hardlinks properly.  Don't process files with
-m again in the second pass if they failed in the first pass.

12 years agoWire -q also in getopt_long argument.
Jakub Jelinek [Wed, 23 May 2012 17:44:50 +0000 (19:44 +0200)]
Wire -q also in getopt_long argument.

12 years agoCompile with -D_FILE_OFFSET_BITS=64.
Jakub Jelinek [Wed, 23 May 2012 16:17:43 +0000 (18:17 +0200)]
Compile with -D_FILE_OFFSET_BITS=64.

12 years agoAdd -q option to make it more quiet.
Jakub Jelinek [Wed, 23 May 2012 15:35:55 +0000 (17:35 +0200)]
Add -q option to make it more quiet.

12 years agoSave some more memory by removing die_cu fields from struct dw_die.
Jakub Jelinek [Wed, 23 May 2012 10:35:47 +0000 (12:35 +0200)]
Save some more memory by removing die_cu fields from struct dw_die.
Instead, the compile_unit/partial_unit die is tagged with die_root
bit, and die_parent is then a struct dw_cu pointer rather than
die pointer (before it was NULL).  To find a cu for any die
a new die_cu inline has been added.

12 years agoUse origin instead of die->die_nextdup in DW_TAG_imported_unit handling.
Jakub Jelinek [Wed, 23 May 2012 10:29:50 +0000 (12:29 +0200)]
Use origin instead of die->die_nextdup in DW_TAG_imported_unit handling.

12 years agoDon't segfault if fi_multifile create_import_tree doesn't find
Jakub Jelinek [Tue, 22 May 2012 16:16:25 +0000 (18:16 +0200)]
Don't segfault if fi_multifile create_import_tree doesn't find
anything worthwhile from alternate DIE set.

12 years agoFix size computation for DW_FORM_string DW_AT_comp_dir attribute on PUs.
Jakub Jelinek [Tue, 22 May 2012 14:27:36 +0000 (16:27 +0200)]
Fix size computation for DW_FORM_string DW_AT_comp_dir attribute on PUs.

12 years agoFix error handling during {rd,fi}_multifile.
Jakub Jelinek [Tue, 22 May 2012 12:35:52 +0000 (14:35 +0200)]
Fix error handling during {rd,fi}_multifile.

12 years agoReplace referenced children during collapsing with 16 (resp. 12) bytes
Jakub Jelinek [Tue, 22 May 2012 10:18:02 +0000 (12:18 +0200)]
Replace referenced children during collapsing with 16 (resp. 12) bytes
long die_collapsed_child to further save memory during optimize_multifile.

12 years agoSave memory during optimize_multifile by collapsing non-referenced
Jakub Jelinek [Fri, 18 May 2012 19:15:04 +0000 (21:15 +0200)]
Save memory during optimize_multifile by collapsing non-referenced
children of toplevel dies and expanding them again if needed
for die_eq_1 (anything that gets expanded will be kept expanded
afterwards).

12 years agoAssume that in GCC created .debug_types abbrev offsets only increase
Jakub Jelinek [Fri, 18 May 2012 10:41:25 +0000 (12:41 +0200)]
Assume that in GCC created .debug_types abbrev offsets only increase
(or are the same as in last section).

12 years agoAdd a hashtable for abbrev offsets to decrease amount of abbrev_tag
Jakub Jelinek [Fri, 18 May 2012 10:38:33 +0000 (12:38 +0200)]
Add a hashtable for abbrev offsets to decrease amount of abbrev_tag
alloced memory and decrease number of read_abbrev calls if
abbrev offsets in CUs don't increase monotonically (common for
dwz adjusted/created CUs).

12 years agoDuring multifile_optimize, remove from off_htab all DIEs that are
Jakub Jelinek [Fri, 18 May 2012 07:47:39 +0000 (09:47 +0200)]
During multifile_optimize, remove from off_htab all DIEs that are
never referenced using DW_FORM_* attributes.

12 years agoHandle even dups (arguably producer bugs) even within a single CU.
Jakub Jelinek [Thu, 17 May 2012 14:56:16 +0000 (16:56 +0200)]
Handle even dups (arguably producer bugs) even within a single CU.

12 years agoDon't make distinction between former PUs and former CUs, put length
Jakub Jelinek [Thu, 17 May 2012 14:49:27 +0000 (16:49 +0200)]
Don't make distinction between former PUs and former CUs, put length
7 CU markers just after each DSO/executable chunk of CUs.  For
non-op_multifile mode use cu_chunk as a CU counter rather than keeping
it at 0.

12 years agoFix up updating .debug_types in -m mode - put .debug_types
Jakub Jelinek [Thu, 17 May 2012 14:47:58 +0000 (16:47 +0200)]
Fix up updating .debug_types in -m mode - put .debug_types
section into the SAVED_SECTIONS group.

12 years agoRewrite .debug_types sections.
Jakub Jelinek [Tue, 15 May 2012 14:54:27 +0000 (16:54 +0200)]
Rewrite .debug_types sections.

12 years agoClear alt_off_htab on read_multifile failures.
Jakub Jelinek [Tue, 15 May 2012 14:53:11 +0000 (16:53 +0200)]
Clear alt_off_htab on read_multifile failures.

12 years agoAdd .gnu_debugaltlink sections during fi_multifile phase.
Jakub Jelinek [Mon, 14 May 2012 15:31:38 +0000 (17:31 +0200)]
Add .gnu_debugaltlink sections during fi_multifile phase.

12 years agoDon't leak macro_htab hash tables.
Jakub Jelinek [Mon, 14 May 2012 15:30:11 +0000 (17:30 +0200)]
Don't leak macro_htab hash tables.

12 years agoAdd support for rewriting .debug_macro sections.
Jakub Jelinek [Mon, 14 May 2012 11:11:44 +0000 (13:11 +0200)]
Add support for rewriting .debug_macro sections.

12 years agoDuring partition_dups_1 second_phase only include non-referenced
Jakub Jelinek [Fri, 11 May 2012 13:13:08 +0000 (15:13 +0200)]
During partition_dups_1 second_phase only include non-referenced
DIEs alongside with referenced ones if they can't reference
DIEs not moved into PUs.

12 years agoIn note_strp_offset2 during optimize_multifile record even off == 0
Jakub Jelinek [Fri, 11 May 2012 07:49:32 +0000 (09:49 +0200)]
In note_strp_offset2 during optimize_multifile record even off == 0
uses.

12 years agoFix up get_AT and get_AT_string for fi_multifile.
Jakub Jelinek [Fri, 11 May 2012 07:08:30 +0000 (09:08 +0200)]
Fix up get_AT and get_AT_string for fi_multifile.

12 years agoAlways perform parent check in die_eq_1 for toplevel dies,
Jakub Jelinek [Fri, 11 May 2012 06:50:08 +0000 (08:50 +0200)]
Always perform parent check in die_eq_1 for toplevel dies,
Remove unneeded inside{1,2} testing.

12 years agoBackport rth's
Jakub Jelinek [Thu, 10 May 2012 19:21:35 +0000 (21:21 +0200)]
Backport rth's
2002-04-09  Richard Henderson  <rth@redhat.com>

* hashtab.c (higher_prime_number): Use 7 as minimum.
(find_empty_slot_for_expand): Don't compute hash2 unless needed.
(htab_find_slot_with_hash): Likewise.
change.

12 years agoIn partition_find_dups during optimize_multifile ignore DIEs that
Jakub Jelinek [Thu, 10 May 2012 19:19:26 +0000 (21:19 +0200)]
In partition_find_dups during optimize_multifile ignore DIEs that
have dups (due to compiler bugs) only within the same DSO or executable.

12 years agoFree new_data in op_multfile, add some debugging code, whitespace cleanup.
Jakub Jelinek [Thu, 10 May 2012 17:14:08 +0000 (19:14 +0200)]
Free new_data in op_multfile, add some debugging code, whitespace cleanup.

12 years agofinalize_strp during fi_multifile before checking section sizes.
Jakub Jelinek [Thu, 10 May 2012 14:57:56 +0000 (16:57 +0200)]
finalize_strp during fi_multifile before checking section sizes.

12 years agoFix test whether attributes extend beyond end of CU.
Jakub Jelinek [Thu, 10 May 2012 14:34:36 +0000 (16:34 +0200)]
Fix test whether attributes extend beyond end of CU.

12 years agoAdd .note.gnu.build-id section to the common file.
Jakub Jelinek [Thu, 10 May 2012 13:45:26 +0000 (15:45 +0200)]
Add .note.gnu.build-id section to the common file.

12 years agoFurther multifile optimization work.
Jakub Jelinek [Thu, 10 May 2012 12:49:15 +0000 (14:49 +0200)]
Further multifile optimization work.

12 years agoDon't emit any DW_TAG_imported_unit DIEs into the temporary file.
Jakub Jelinek [Fri, 4 May 2012 12:48:39 +0000 (14:48 +0200)]
Don't emit any DW_TAG_imported_unit DIEs into the temporary file.

12 years ago- cache read_debug_line results to decrease memory usage
Jakub Jelinek [Thu, 3 May 2012 19:36:36 +0000 (21:36 +0200)]
- cache read_debug_line results to decrease memory usage
- put DIEs that won't be needed again into freelist, allocate from that
- clear die_op_type_referenced during wr_multifile
- use ELF_C_WRITE instead of ELC_C_WRITE_MMAP in elf_begin

12 years agoUse ELF_C_WRITE instead of ELF_C_WRITE_MMAP for elf_begin, it is
Jakub Jelinek [Thu, 3 May 2012 19:06:40 +0000 (21:06 +0200)]
Use ELF_C_WRITE instead of ELF_C_WRITE_MMAP for elf_begin, it is
faster and doesn't leak mmapped region.

12 years agoFurther work on multi-file support, build from the gathered
Jakub Jelinek [Thu, 3 May 2012 15:15:53 +0000 (17:15 +0200)]
Further work on multi-file support, build from the gathered
sections a common file with DIEs and strings worth sharing between
different object files.

12 years agoFix up handling of DW_FORM_ref_addr in write_die.
Jakub Jelinek [Thu, 3 May 2012 14:48:12 +0000 (16:48 +0200)]
Fix up handling of DW_FORM_ref_addr in write_die.

12 years agoDuring partition_dups, force together with anything that is worthwhile
Jakub Jelinek [Thu, 3 May 2012 12:09:57 +0000 (14:09 +0200)]
During partition_dups, force together with anything that is worthwhile
to put into PUs also any DIEs that are referenced by those (even indirectly),
and any DIEs that are dups and referenced by the same set of CUs.
This way PUs should no longer DW_FORM_ref_addr to CU DIEs, unless they
were using DW_FORM_ref_addr already before.

12 years agoFurther little steps towards multi-file optimization.
Jakub Jelinek [Mon, 30 Apr 2012 16:46:58 +0000 (18:46 +0200)]
Further little steps towards multi-file optimization.

12 years agoFirst step towards multifile DWARF optimizations.
Jakub Jelinek [Mon, 30 Apr 2012 14:17:25 +0000 (16:17 +0200)]
First step towards multifile DWARF optimizations.
While handling input files normally, this gathers interesting
data in temporary files for .debug_{info,abbrev,line,str} sections,
then right now skips optimization pass on the gathered sections
and writes the result into the filename given by -m option.

12 years agoSmall bugfixes and code cleanups.
Jakub Jelinek [Mon, 30 Apr 2012 06:31:48 +0000 (08:31 +0200)]
Small bugfixes and code cleanups.

12 years agoHandle DW_AT_start_scope with DW_FORM_sec_offset like DW_AT_ranges
Jakub Jelinek [Thu, 26 Apr 2012 12:14:28 +0000 (14:14 +0200)]
Handle DW_AT_start_scope with DW_FORM_sec_offset like DW_AT_ranges
- avoid dup checking for DIEs containing it.

12 years agoAdjust .debug_aranges section if present.
Jakub Jelinek [Thu, 26 Apr 2012 10:30:02 +0000 (12:30 +0200)]
Adjust .debug_aranges section if present.

12 years agoPut new_data and new_size info about debug sections directly into
Jakub Jelinek [Thu, 26 Apr 2012 09:20:15 +0000 (11:20 +0200)]
Put new_data and new_size info about debug sections directly into
debug_sections array, to simplify write_dso and not passing around
too many pointers and sizes.

12 years agoOptimize DW_AT_high_pc DW_FORM_addr for DWARF4+ into constant
Jakub Jelinek [Wed, 25 Apr 2012 16:53:44 +0000 (18:53 +0200)]
Optimize DW_AT_high_pc DW_FORM_addr for DWARF4+ into constant
class form DW_AT_high_pc (which is the size of the entity rather than
address of the first byte after it).

12 years ago.gdb_index support, for versions 4-6 try to update it, otherwise
Jakub Jelinek [Tue, 24 Apr 2012 09:20:47 +0000 (11:20 +0200)]
.gdb_index support, for versions 4-6 try to update it, otherwise
remove it.

12 years agoIMPORTANT: usage change, no works similarly to strip.
Jakub Jelinek [Fri, 20 Apr 2012 16:47:46 +0000 (18:47 +0200)]
IMPORTANT: usage change, no works similarly to strip.
dwz file
will modify file in place (well, write to temporary, rename over),
dwz -o outfile file
will do what dwz file outfile did before.
dwz file1 file2 file3
will modify all the files in place,
dwz
will modify a.out in place,
dwz -o b.out
will modify a.out into b.out.

In addition to that this change revamps the OOM handling to just
not handle the single currently handled file, complain,
cleanup all memory and continue with the next file.

12 years agoSecond part of memory management cleanups. For permanently
Jakub Jelinek [Fri, 20 Apr 2012 07:06:59 +0000 (09:06 +0200)]
Second part of memory management cleanups.  For permanently
(well, for the duration of handling a single file) allocated objects
use a big pool allocator that doesn't unnecessarily align everything
to 16 bytes and allocates in ~ 16MB chunks rather than 4KB.
This decreases memory usage a little bit on large testcases and
speeds things a tiny bit up.
Also, avoid obstacks local to function, for memory allocation failures
if in the future we use longjmp those might not be freed.

12 years agoDon't htab_delete cu->cu_new_abbrev if it is already NULL
Jakub Jelinek [Fri, 20 Apr 2012 07:04:56 +0000 (09:04 +0200)]
Don't htab_delete cu->cu_new_abbrev if it is already NULL
(happens for some .debug_types CUs).

12 years agoFirst pass at memory management cleanup. Ensure (so far only for success)
Jakub Jelinek [Fri, 20 Apr 2012 05:49:36 +0000 (07:49 +0200)]
First pass at memory management cleanup.  Ensure (so far only for success)
that all memory is freed before exit.

12 years agoUndo optimistic die_dup/die_nextdup linking on failures in reverse
Jakub Jelinek [Thu, 19 Apr 2012 15:29:44 +0000 (17:29 +0200)]
Undo optimistic die_dup/die_nextdup linking on failures in reverse
order of their addition.

12 years agoIgnore .debug_gdb_scripts sections.
Jakub Jelinek [Thu, 19 Apr 2012 11:45:08 +0000 (13:45 +0200)]
Ignore .debug_gdb_scripts sections.

12 years agoUse just u.p1.die_ref_hash instead of u.p1.die_hash ^ u.p1.die_ref_hash
Jakub Jelinek [Thu, 19 Apr 2012 11:43:17 +0000 (13:43 +0200)]
Use just u.p1.die_ref_hash instead of u.p1.die_hash ^ u.p1.die_ref_hash
as hash in the dup_htab hash table.  die_ref_hash has die_hash iteratively
hashed in already, and on leaf DIEs is equal to die_hash, so the xor
resulted in 0 for all leaf DIEs.

12 years agoImprove ref_hash computation in cycles - add the forgotten
Jakub Jelinek [Thu, 19 Apr 2012 11:41:37 +0000 (13:41 +0200)]
Improve ref_hash computation in cycles - add the forgotten
addition of *second_idx, so it doesn't hash in always 0.

12 years agoOptimize .debug_abbrev handling for .debug_types section. If
Jakub Jelinek [Thu, 19 Apr 2012 11:39:48 +0000 (13:39 +0200)]
Optimize .debug_abbrev handling for .debug_types section.  If
adjacent .debug_types CUs have the same .debug_abbrev offsets, just
read it once and point the others to the abbrev table owner's CU.

12 years agoFix a thinko that causes
Jakub Jelinek [Thu, 19 Apr 2012 11:37:11 +0000 (13:37 +0200)]
Fix a thinko that causes
create_import_tree: Assertion `ipu2->idx >= npus + ncus' failed.
on some objects.

12 years agoRevamp die_dup/die_nextdup for easier debugging. Instead of
Jakub Jelinek [Thu, 19 Apr 2012 11:35:19 +0000 (13:35 +0200)]
Revamp die_dup/die_nextdup for easier debugging.  Instead of
two separate structures where second one contains the first at the
beginning just put the die_dup/die_nextdup fields last in the
single structure and for !die_toplevel DIEs just allocate using
offsetof (struct dw_die, die_dup) size (so those two fields will be
garbage).

12 years agodwz-0.1 - first public release dwz-0.1
Jakub Jelinek [Thu, 19 Apr 2012 11:32:50 +0000 (13:32 +0200)]
dwz-0.1 - first public release

This page took 0.04311 seconds and 5 git commands to generate.