aboutsummaryrefslogtreecommitdiff
path: root/binutils/objdump.c
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>1996-01-25 18:52:59 +0000
committerIan Lance Taylor <ian@airs.com>1996-01-25 18:52:59 +0000
commit1efb2ef0075ef7b4882172bd77a9127b24432513 (patch)
tree2be1e05fb3335854d35f17d7c629213f3b240891 /binutils/objdump.c
parent4fe0fdddfb958c29f03c83c1eaf304bd63fdf096 (diff)
downloadbinutils-1efb2ef0075ef7b4882172bd77a9127b24432513.zip
binutils-1efb2ef0075ef7b4882172bd77a9127b24432513.tar.gz
binutils-1efb2ef0075ef7b4882172bd77a9127b24432513.tar.bz2
* objdump.c (dump_headers, dump_section_header): Change objdump -h
output to be simpler and to include section file offsets.
Diffstat (limited to 'binutils/objdump.c')
-rw-r--r--binutils/objdump.c32
1 files changed, 20 insertions, 12 deletions
diff --git a/binutils/objdump.c b/binutils/objdump.c
index f45c8a9..acb4c50 100644
--- a/binutils/objdump.c
+++ b/binutils/objdump.c
@@ -193,20 +193,22 @@ dump_section_header (abfd, section, ignored)
{
char *comma = "";
-#define PF(x,y) \
- if (section->flags & x) { printf("%s%s",comma,y); comma = ", "; }
+ printf ("%3d %-14s%08lx ", section->index,
+ bfd_get_section_name (abfd, section),
+ (unsigned long) bfd_section_size (abfd, section));
+ printf_vma (bfd_get_section_vma (abfd, section));
+ printf (" ");
+ printf_vma (section->lma);
+ printf (" %08lx 2**%u", section->filepos,
+ bfd_get_section_alignment (abfd, section));
+ if (! wide_output)
+ printf ("\n ");
+ printf (" ");
+#define PF(x, y) \
+ if (section->flags & x) { printf ("%s%s", comma, y); comma = ", "; }
- printf ("SECTION %d [%s]\t: size %08x",
- section->index,
- section->name,
- (unsigned) bfd_get_section_size_before_reloc (section));
- printf (" vma ");
- printf_vma (section->vma);
- printf (" lma ");
- printf_vma (section->lma);
- printf (" align 2**%u%s ",
- section->alignment_power, (wide_output) ? "" : "\n");
+ PF (SEC_HAS_CONTENTS, "CONTENTS");
PF (SEC_ALLOC, "ALLOC");
PF (SEC_CONSTRUCTOR, "CONSTRUCTOR");
PF (SEC_CONSTRUCTOR_TEXT, "CONSTRUCTOR TEXT");
@@ -233,6 +235,12 @@ static void
dump_headers (abfd)
bfd *abfd;
{
+ printf ("Sections:\n");
+#ifndef BFD64
+ printf ("Idx Name Size VMA LMA File off Algn\n");
+#else
+ printf ("Idx Name Size VMA LMA File off Algn\n");
+#endif
bfd_map_over_sections (abfd, dump_section_header, (PTR) NULL);
}