This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
displays dynamic segment even if no .dynamic section
- From: Tristan Gingold <gingold at adacore dot com>
- To: binutils at sourceware dot org
- Date: Mon, 25 Jun 2007 14:42:32 +0200
- Subject: displays dynamic segment even if no .dynamic section
Hi,
currently dynamic segment of VMS itanium (ELF format) cannot be
displayed because there is no .dynamic section in the section table.
This patch fixes the issue by always using dynamic segment unless
there is a .dynamic section.
binutils:
2007-06-25 Tristan Gingold <gingold@adacore.com>
* readelf.c (process_program_headers): use DYNAMIC segment unless
.dynamic section is found.
*** readelf.c 30 May 2007 14:29:27 -0000 1.365
--- readelf.c 25 Jun 2007 12:30:55 -0000
*************** process_program_headers (FILE *file)
*** 3503,3508 ****
--- 3503,3513 ----
if (dynamic_addr)
error (_("more than one dynamic segment\n"));
+ /* By default, we can only assume that the .dynamic
+ section is the first section in the DYNAMIC segment. */
+ dynamic_addr = segment->p_offset;
+ dynamic_size = segment->p_filesz;
+
/* Try to locate the .dynamic section. If there is
a section header table, we can easily locate it. */
if (section_headers != NULL)
*************** process_program_headers (FILE *file)
*** 3528,3540 ****
else if (dynamic_addr > segment->p_offset)
warn (_("the .dynamic section is not the first
section in the dynamic segment.\n"));
}
- else
- {
- /* Otherwise, we can only assume that the .dynamic
- section is the first section in the DYNAMIC
segment. */
- dynamic_addr = segment->p_offset;
- dynamic_size = segment->p_filesz;
- }
break;
case PT_INTERP:
--- 3533,3538 ----