[Differential] [Request, 6 lines] D1826: libdwarf: Add symbol value when processing .rela relocations

emaste (Ed Maste) phabric-noreply at FreeBSD.org
Wed Feb 11 19:03:47 UTC 2015


emaste created this revision.
emaste added a subscriber: freebsd-toolchain.

REVISION SUMMARY
  In practice .rela debug relocations often use the the .debug_* sections as the symbol, which has the value 0:
  ```
  Relocation section '.rela.debug_info' at offset 0xd18 contains 205 entries:
    Offset          Info           Type           Sym. Value    Sym. Name + Addend
  000000000006  001a0000000a R_X86_64_32       0000000000000000 .debug_abbrev + 0
  00000000000c  001e0000000a R_X86_64_32       0000000000000000 .debug_str + 0
  000000000012  001e0000000a R_X86_64_32       0000000000000000 .debug_str + 45
  ```
  so in those cases there is no difference if the symbol value is used in the relocation or not.
  
  It is not always the case though:
  ```
  000000000039  002700000001 R_X86_64_64       0000000000000010 xen_pci_driver + 0
  ```

REVISION DETAIL
  https://reviews.freebsd.org/D1826

AFFECTED FILES
  libdwarf/libdwarf_elf_init.c

To: emaste
Cc: freebsd-toolchain


More information about the freebsd-toolchain mailing list