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 | b1a6d0b1cbfcf751215209dbbb549269d889693a (patch) | |
tree | 1e7df97324cafd88958bef2771836a42463c6a71 /bfd/elf.c | |
parent | 1a320fbbe5a7c23461f7cb78266fcd8b9f4f5618 (diff) | |
download | gdb-b1a6d0b1cbfcf751215209dbbb549269d889693a.zip gdb-b1a6d0b1cbfcf751215209dbbb549269d889693a.tar.gz gdb-b1a6d0b1cbfcf751215209dbbb549269d889693a.tar.bz2 |
* elf.c (assign_file_positions_for_segments): Make sure the .dynamic section
is the first section in the PT_DYNAMIC segment
Diffstat (limited to 'bfd/elf.c')
-rw-r--r-- | bfd/elf.c | 12 |
1 files changed, 12 insertions, 0 deletions
@@ -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; |