diff options
author | Nathan Sidwell <nathan@codesourcery.com> | 2007-01-11 12:23:53 +0000 |
---|---|---|
committer | Nathan Sidwell <nathan@codesourcery.com> | 2007-01-11 12:23:53 +0000 |
commit | 59e0647f0d3c0176557aef0f0d6fc14ee44a0b2a (patch) | |
tree | 24b862907e031ac594072b2dea3a720d1f0dfb38 /ld/emultempl | |
parent | e2204714e24debd8c495122615ea1582724db750 (diff) | |
download | gdb-59e0647f0d3c0176557aef0f0d6fc14ee44a0b2a.zip gdb-59e0647f0d3c0176557aef0f0d6fc14ee44a0b2a.tar.gz gdb-59e0647f0d3c0176557aef0f0d6fc14ee44a0b2a.tar.bz2 |
bfd/
* elf.c (assign_file_positions_for_load_sections): We can
require fewer phdrs than expected.
ld/
* emultempl/elf-generic.em (gdl_map_segments): Only allow header
shrinkage for the first few iterations.
ld/testsuite/
* ld-elf/header.d: New.
* ld-elf/header.t: New.
* ld-elf/header.s: New.
Diffstat (limited to 'ld/emultempl')
-rw-r--r-- | ld/emultempl/elf-generic.em | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/ld/emultempl/elf-generic.em b/ld/emultempl/elf-generic.em index dd0907c..7edee8b 100644 --- a/ld/emultempl/elf-generic.em +++ b/ld/emultempl/elf-generic.em @@ -60,7 +60,17 @@ gld${EMULATION_NAME}_map_segments (bfd_boolean need_layout) einfo ("%F%P: map sections to segments failed: %E\n"); if (phdr_size != elf_tdata (output_bfd)->program_header_size) - need_layout = TRUE; + { + if (tries > 6) + /* The first few times we allow any change to + phdr_size . */ + need_layout = TRUE; + else if (phdr_size < elf_tdata (output_bfd)->program_header_size) + /* After that we only allow the size to grow. */ + need_layout = TRUE; + else + elf_tdata (output_bfd)->program_header_size = phdr_size; + } } } while (need_layout && --tries); |