https://sourceware.org/bugzilla/show_bug.cgi?id=24717

            Bug ID: 24717
           Summary: .note.gnu.property sections are not stored at an
                    offset equal to their VMA in debuginfo files
           Product: binutils
           Version: 2.33 (HEAD)
            Status: NEW
          Severity: normal
          Priority: P2
         Component: ld
          Assignee: unassigned at sourceware dot org
          Reporter: nickc at redhat dot com
  Target Milestone: ---

The file offset of the .note.gnu.property section in a debuginfo file does not
match its VMA.  For example:

  % readelf --wide -S /usr/lib/systemd/libsystemd-shared-239.so 
  [Nr] Name              Type    Address          Off    Size   ES Flg Lk Inf
Al
  [...]
  [19] .note.gnu.property NOTE   00000000001fde88 1fde88 000020 00   A  0   0 
8

Note that the offset matches the address.  This matters because of how
sections are mapped to segments:

  % readelf --wide -l  /usr/lib/systemd/libsystemd-shared-239.so
  Type   Offset   VirtAddr           PhysAddr           FileSiz  MemSiz  Flg Al
  [...] 
  NOTE  0x1fde88 0x00000000001fde88 0x00000000001fde88 0x000020 0x000020 R  0x8
  [...]
  06     .note.gnu.property 

By contrast, in the debuginfo file for this shared library, the offset of the
.note.gnu.property section has been changed:

  % readelf --wide -S
/usr/lib/debug/usr/lib/systemd/libsystemd-shared-239.so-239-11.git4dc7dce.fc29.x86_64.debug
  [...]
  [Nr] Name              Type   Address          Off    Size   ES Flg Lk Inf Al
  [...]
  [19] .note.gnu.property NOTE  00000000001fcd18 0002e0 000020 00   A  0   0  8

So now the .note.gnu.property section is no longer mapped to segment 6:

 readelf --wide -l
/usr/lib/debug/usr/lib/systemd/libsystemd-shared-239.so-239-11.git4dc7dce.fc29.x86_64.debug
  [...]
  Type  Offset   VirtAddr           PhysAddr           FileSiz  MemSiz   Flg Al
  NOTE  0x1fcd18 0x00000000001fcd18 0x00000000001fcd18 0x000020 0x000020 R  
0x8
  [...]
  06     

It is also worth pointing out that the same issue does not affect the
.note.build-id section...

  This also means that when the debuginfo file is processed either by gdb or
objcopy, a warning is generated:

  warning: allocated section `.note.gnu.property' not in segment


This PR is in response to Fedora BZ 1553086:
https://bugzilla.redhat.com/show_bug.cgi?id=1553086

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils

Reply via email to