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.
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.
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).
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.
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.
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.
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.
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).