X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=binutils%2Fobjdump.c;h=f94dee968e27ce452351de71cd50d4fbfa081050;hb=8ea5bce59057ef1906bf1180843c0900b191dcab;hp=44d363bb025da61d52e2f49591fe0896cf9c6855;hpb=3d540e936bbc1b6971acd7bbb623b92a704f537e;p=binutils-gdb.git diff --git a/binutils/objdump.c b/binutils/objdump.c index 44d363bb025..f94dee968e2 100644 --- a/binutils/objdump.c +++ b/binutils/objdump.c @@ -205,7 +205,8 @@ usage (FILE *stream, int status) -G, --stabs Display (in raw form) any STABS info in the file\n\ -W[lLiaprmfFsoRt] or\n\ --dwarf[=rawline,=decodedline,=info,=abbrev,=pubnames,=aranges,=macro,=frames,\n\ - =frames-interp,=str,=loc,=Ranges,=pubtypes]\n\ + =frames-interp,=str,=loc,=Ranges,=pubtypes,\n\ + =trace_info,=trace_abbrev,=trace_aranges]\n\ Display DWARF info in the file\n\ -t, --syms Display the contents of the symbol table(s)\n\ -T, --dynamic-syms Display the contents of the dynamic symbol table\n\ @@ -2204,14 +2205,8 @@ load_specific_debug_section (enum dwarf_section_display_enum debug, section->size = bfd_get_section_size (sec); section->start = (unsigned char *) xmalloc (section->size); - if (is_relocatable && debug_displays [debug].relocate) - ret = bfd_simple_get_relocated_section_contents (abfd, - sec, - section->start, - syms) != NULL; - else - ret = bfd_get_section_contents (abfd, sec, section->start, 0, - section->size); + ret = bfd_get_section_contents (abfd, sec, section->start, 0, + section->size); if (! ret) { @@ -2233,6 +2228,30 @@ load_specific_debug_section (enum dwarf_section_display_enum debug, section->size = size; } + if (is_relocatable && debug_displays [debug].relocate) + { + /* We want to relocate the data we've already read (and + decompressed), so we store a pointer to the data in + the bfd_section, and tell it that the contents are + already in memory. */ + sec->contents = section->start; + sec->flags |= SEC_IN_MEMORY; + sec->size = section->size; + + ret = bfd_simple_get_relocated_section_contents (abfd, + sec, + section->start, + syms) != NULL; + + if (! ret) + { + free_debug_section (debug); + printf (_("\nCan't get contents for section '%s'.\n"), + section->name); + return 0; + } + } + return 1; }