diff options
author | Clément Chigot <clement.chigot@atos.net> | 2021-06-11 11:00:56 +0200 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2021-07-14 21:40:05 +0930 |
commit | 51d29b8cacd75865a9ffc46cffffe1e47c33ccff (patch) | |
tree | 8800eb84ab44902fb543d25dfa7ad60f29503b6b /bfd | |
parent | be36c6e3374821fe5699556bbfa2280e3a4696df (diff) | |
download | gdb-51d29b8cacd75865a9ffc46cffffe1e47c33ccff.zip gdb-51d29b8cacd75865a9ffc46cffffe1e47c33ccff.tar.gz gdb-51d29b8cacd75865a9ffc46cffffe1e47c33ccff.tar.bz2 |
objdump: add DWARF support for AIX
DWARF sections have special names on AIX which need be handled
by objdump in order to correctly print them.
This patch also adds the correlation in bfd for future uses.
bfd/
* libxcoff.h (struct xcoff_dwsect_name): Add DWARF name.
* coff-rs6000.c (xcoff_dwsect_names): Update.
* coffcode.h (sec_to_styp_flags): Likewise.
(coff_new_section_hook): Likewise.
binutils/
* dwarf.h (struct dwarf_section): Add XCOFF name.
* dwarf.c (struct dwarf_section_display): Update.
* objdump.c (load_debug_section): Add XCOFF name handler.
(dump_dwarf_section): Likewise.
gas/
* config/tc-ppc.c (ppc_change_debug_section): Update to
match new name's field.
Diffstat (limited to 'bfd')
-rw-r--r-- | bfd/ChangeLog | 7 | ||||
-rw-r--r-- | bfd/coff-rs6000.c | 26 | ||||
-rw-r--r-- | bfd/coffcode.h | 4 | ||||
-rw-r--r-- | bfd/libxcoff.h | 5 |
4 files changed, 27 insertions, 15 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 4dc3d68..ff44a7e 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,10 @@ +2021-07-14 Clément Chigot <clement.chigot@atos.net> + + * libxcoff.h (struct xcoff_dwsect_name): Add DWARF name. + * coff-rs6000.c (xcoff_dwsect_names): Update. + * coffcode.h (sec_to_styp_flags): Likewise. + (coff_new_section_hook): Likewise. + 2021-07-10 Alan Modra <amodra@gmail.com> * dwarf2.c (read_address): Remove accidental commit. diff --git a/bfd/coff-rs6000.c b/bfd/coff-rs6000.c index a1c62d4..689f9f5 100644 --- a/bfd/coff-rs6000.c +++ b/bfd/coff-rs6000.c @@ -4265,20 +4265,22 @@ static const unsigned long xcoff_glink_code[9] = 0x00000000, /* traceback table */ }; -/* Table to convert DWARF flags to section names. */ +/* Table to convert DWARF flags to section names. + Remember to update binutils/dwarf.c:debug_displays + if new DWARF sections are supported by XCOFF. */ const struct xcoff_dwsect_name xcoff_dwsect_names[] = { - { SSUBTYP_DWINFO, ".dwinfo", true }, - { SSUBTYP_DWLINE, ".dwline", true }, - { SSUBTYP_DWPBNMS, ".dwpbnms", true }, - { SSUBTYP_DWPBTYP, ".dwpbtyp", true }, - { SSUBTYP_DWARNGE, ".dwarnge", true }, - { SSUBTYP_DWABREV, ".dwabrev", false }, - { SSUBTYP_DWSTR, ".dwstr", true }, - { SSUBTYP_DWRNGES, ".dwrnges", true }, - { SSUBTYP_DWLOC, ".dwloc", true }, - { SSUBTYP_DWFRAME, ".dwframe", true }, - { SSUBTYP_DWMAC, ".dwmac", true } + { SSUBTYP_DWINFO, ".dwinfo", ".debug_info", true }, + { SSUBTYP_DWLINE, ".dwline", ".debug_line", true }, + { SSUBTYP_DWPBNMS, ".dwpbnms", ".debug_pubnames", true }, + { SSUBTYP_DWPBTYP, ".dwpbtyp", ".debug_pubtypes", true }, + { SSUBTYP_DWARNGE, ".dwarnge", ".debug_aranges", true }, + { SSUBTYP_DWABREV, ".dwabrev", ".debug_abbrev", false }, + { SSUBTYP_DWSTR, ".dwstr", ".debug_str", true }, + { SSUBTYP_DWRNGES, ".dwrnges", ".debug_ranges", true }, + { SSUBTYP_DWLOC, ".dwloc", ".debug_loc", true }, + { SSUBTYP_DWFRAME, ".dwframe", ".debug_frame", true }, + { SSUBTYP_DWMAC, ".dwmac", ".debug_macro", true } }; /* For generic entry points. */ diff --git a/bfd/coffcode.h b/bfd/coffcode.h index f65f335..9b8798c 100644 --- a/bfd/coffcode.h +++ b/bfd/coffcode.h @@ -577,7 +577,7 @@ sec_to_styp_flags (const char *sec_name, flagword sec_flags) int i; for (i = 0; i < XCOFF_DWSECT_NBR_NAMES; i++) - if (!strcmp (sec_name, xcoff_dwsect_names[i].name)) + if (!strcmp (sec_name, xcoff_dwsect_names[i].xcoff_name)) { styp_flags = STYP_DWARF | xcoff_dwsect_names[i].flag; break; @@ -1809,7 +1809,7 @@ coff_new_section_hook (bfd * abfd, asection * section) for (i = 0; i < XCOFF_DWSECT_NBR_NAMES; i++) if (strcmp (bfd_section_name (section), - xcoff_dwsect_names[i].name) == 0) + xcoff_dwsect_names[i].xcoff_name) == 0) { section->alignment_power = 0; sclass = C_DWARF; diff --git a/bfd/libxcoff.h b/bfd/libxcoff.h index 2eeb503..4556a38 100644 --- a/bfd/libxcoff.h +++ b/bfd/libxcoff.h @@ -244,7 +244,10 @@ struct xcoff_dwsect_name { unsigned int flag; /* Corresponding XCOFF section name. */ - const char *name; + const char *xcoff_name; + + /* Corresponding DWARF section name. */ + const char *dwarf_name; /* True if size must be prepended. */ bool def_size; |