Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does "readelf: Warning: Corrupt offset in range entry N" mean?

I am running readelf -w on my (C++) executable to examine some debug sections and it prints the following warnings a couple of times:

$ readelf -w a.out
...
readelf: Warning: Corrupt offset (0x00000028) in range entry 1
readelf: Warning: Corrupt offset (0x00000044) in range entry 2
readelf: Warning: Corrupt offset (0x00000054) in range entry 3
...

I have no clue what this means and neither the manpage nor Google could help. Can anyone enlighten me?

like image 673
andreee Avatar asked Oct 29 '25 21:10

andreee


1 Answers

The error comes from dwarf.c here:

  for (i = 0; i < num_range_list; i++)
...
      if (offset > (size_t) (finish - section_begin))
        {
          warn (_("Corrupt offset (%#" PRIx64 ") in range entry %u\n"),
                offset, i);
          continue;
        }

What this means is hard to say without seeing output from readelf --all. It could be that your compiler is producing bad debug info, but it could also be a bug in readelf, possibly this one.

You could try using eu-readelf from the elfutils package, which appears to be better maintained.

like image 61
Employed Russian Avatar answered Nov 01 '25 11:11

Employed Russian



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!