remove remnants of old Mach-O workaround
authorTom Tromey <tromey@redhat.com>
Mon, 9 Dec 2013 22:01:31 +0000 (15:01 -0700)
committerTom Tromey <tromey@redhat.com>
Thu, 19 Dec 2013 15:41:53 +0000 (08:41 -0700)
commitd493b2839b90ba7f4b5200505f94e45268777d7b
tree30469eec17518e5223df4ba02e7489e0b3d012bf
parent9373215cfffc82cd64517ca5ab3e00c13fa0bbfe
remove remnants of old Mach-O workaround

I happened to run readelf on an ELF file created by Guile.  readelf
complained about invalid values for DW_FORM_strp.  At first I assumed
this was just a Guile bug, but eu-readelf did the right thing, so I
looked a bit deeper.

I came across some old Mach-O code to bias some offsets by section
addresses.  Guile, unlike many ELF writers, sets the address for the
various DWARF-related sections, causing this unusual code to be run.

This code came from an old commit:

    2005-09-30  H.J. Lu  <hongjiu.lu@intel.com>

    * dwarf.c (fetch_indirect_string): Adjust for section address.
    (process_debug_info): Likewise.
    (display_debug_loc): Likewise.
    (display_debug_ranges): Likewise.

    * objdump.c (mach_o_dwarf_sections): New.
    (generic_dwarf_sections): Likewise.
    (check_mach_o_dwarf): Likewise.
    (dump_dwarf): Call check_mach_o_dwarf.

However it was partially reverted here:

    https://sourceware.org/ml/binutils/2008-11/msg00134.html

This patch just completes the reversion.

Built and regtested on x86-64 Fedora 18.  I also ran the resulting
readelf against the Guile-created object with success.

I have no way of testing this on Mach-O, so your feedback is
solicited.

2013-12-19  Tom Tromey  <tromey@redhat.com>

* dwarf.c (fetch_indirect_string): Don't bias by section address.
(fetch_indexed_string): Likewise.
(process_debug_info): Likewise.
(display_debug_loc): Likewise.
(display_debug_ranges): Likewise.
binutils/ChangeLog
binutils/dwarf.c