@@ -1981,28 +2002,14 @@ _bfd_dwarf2_find_nearest_line (abfd, sec
{
bfd_vma length;
boolean found;
- 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;
- }
- }
- else
- 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)
{