This is the mail archive of the
mailing list for the binutils project.
Re: [RFA] Perform relocations in dwarf2.c
- From: Daniel Berlin <dberlin at dberlin dot org>
- To: Daniel Jacobowitz <drow at mvista dot com>
- Cc: Michal Ludvig <mludvig at suse dot cz>, binutils at sources dot redhat dot com
- Date: Thu, 24 Oct 2002 14:12:33 -0400
- Subject: Re: [RFA] Perform relocations in dwarf2.c
Something like that.
@@ -1981,28 +2002,14 @@ _bfd_dwarf2_find_nearest_line (abfd, sec
- unsigned int offset_size = addr_size;
- if (addr_size == 4)
- length = read_4_bytes (abfd, stash->info_ptr);
- if (length == 0xffffffff)
- offset_size = 8;
- length = read_8_bytes (abfd, stash->info_ptr + 4);
- stash->info_ptr += 8;
- else if (length == 0)
- /* Handle (non-standard) 64-bit DWARF2 formats. */
- offset_size = 8;
- length = read_4_bytes (abfd, stash->info_ptr + 4);
- stash->info_ptr += 4;
- length = read_8_bytes (abfd, stash->info_ptr);
- stash->info_ptr += addr_size;
+ /* All checked 64b platforms use 32b offsets in .debug_info.
+ * 32b platforms use this size as well, of course. Seems to be
+ * safe to hardcode it here.
+ * Checked on x86-64, alpha, ia64, sparc64 -- mludvig */
+ unsigned int offset_size = 4;
+ length = read_4_bytes (abfd, stash->info_ptr);
+ stash->info_ptr += offset_size;
if (length > 0)
Come on. Look at the CVS history for this file; two people have
changed it in the past year. One branch is for ELF64 and the other is
for some SGI format, I believe.
The length = 0xfffffffff is standard specified 64 bit "offset" DWARF2,
though i think it's actually meant for >4g of debug info on 32 bit
platforms. The pointer size is different and specified elsewhere from
the offset size, the length == 0x0 is SGI "before the standard" 64 bit
"offset" DWARF2 on 32 bit platforms.
The other branch is 64 bit DWARF2 on 64 bit platforms.
He's also removing the checks for what the standard specifically says
is the right thing.
You shouldn't be casually deleting
code like this if you don't even know what platforms it is for.
The list archives would be glad to tell you.
If it doesn't work as is, something else is broken, as the code is