diff options
author | Nick Clifton <nickc@redhat.com> | 2004-07-09 16:06:20 +0000 |
---|---|---|
committer | Nick Clifton <nickc@redhat.com> | 2004-07-09 16:06:20 +0000 |
commit | 7992dc8f3f821165fd282799779971c3787b8638 (patch) | |
tree | 9cb601d4c64e18393a43ad9c9c414c46cd2ee596 | |
parent | 99a147107dd06e180a2d7ceac2117b2d9756ab97 (diff) | |
download | gdb-7992dc8f3f821165fd282799779971c3787b8638.tar.gz |
* elf.c (assign_file_positions_for_segments): Make sure the .dynamic section
is the first section in the PT_DYNAMIC segment
-rw-r--r-- | bfd/ChangeLog | 5 | ||||
-rw-r--r-- | bfd/elf.c | 12 |
2 files changed, 17 insertions, 0 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog index d7bbfe1c9c6..7d8efdd6e2d 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,8 @@ +2004-07-09 Jie Zhang <zhangjie@magima.com.cn> + + * elf.c (assign_file_positions_for_segments): Make sure the + .dynamic section is the first section in the PT_DYNAMIC segment. + 2004-07-09 Nick Clifton <nickc@redhat.com> * config.bfd: Change sh-sybmian-elf to sh-*-symbianelf. diff --git a/bfd/elf.c b/bfd/elf.c index 1525fa55d62..1cf2dc0f245 100644 --- a/bfd/elf.c +++ b/bfd/elf.c @@ -3826,6 +3826,18 @@ assign_file_positions_for_segments (bfd *abfd, struct bfd_link_info *link_info) 1 << align); } } + /* Make sure the .dynamic section is the first section in the + PT_DYNAMIC segment. */ + else if (p->p_type == PT_DYNAMIC + && m->count > 1 + && strcmp (m->sections[0]->name, ".dynamic") != 0) + { + _bfd_error_handler + (_("%s: The first section in the PT_DYNAMIC segment is not the .dynamic section"), + bfd_get_filename (abfd)); + bfd_set_error (bfd_error_bad_value); + return FALSE; + } if (m->count == 0) p->p_vaddr = 0; |