diff options
author | Alan Modra <amodra@gmail.com> | 2006-06-20 16:37:29 +0000 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2006-06-20 16:37:29 +0000 |
commit | f5ff60a6dbea1734faee327a99825461b10f2ae6 (patch) | |
tree | 73824b0702633b20adea1f5ba4cf8c87d266d6c7 /ld/emultempl | |
parent | 6a4a0940e56e3f60f38b2b49991efc0969bc206a (diff) | |
download | gdb-f5ff60a6dbea1734faee327a99825461b10f2ae6.zip gdb-f5ff60a6dbea1734faee327a99825461b10f2ae6.tar.gz gdb-f5ff60a6dbea1734faee327a99825461b10f2ae6.tar.bz2 |
* emultempl/elf-generic.em (gld${EMULATION_NAME}_map_segments): Limit
loop to ten iterations. Throw away any previous linker generated
segment map.
* ldlang.c (lang_phdr_list): Make global.
* ldlang.h (lang_phdr_list): Declare.
* Makefile.am (ELF_GEN_DEPS): Define. Use in emul deps.
* Makefile.in: Regenerate.
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 a573a44..5d65cdc 100644 --- a/ld/emultempl/elf-generic.em +++ b/ld/emultempl/elf-generic.em @@ -26,13 +26,19 @@ cat >>e${EMULATION_NAME}.c <<EOF static void gld${EMULATION_NAME}_map_segments (bfd_boolean need_layout) { - while (1) + int tries = 10; + + while (tries) { if (output_bfd->xvec->flavour == bfd_target_elf_flavour) { bfd_size_type phdr_size; phdr_size = elf_tdata (output_bfd)->program_header_size; + /* If we don't have user supplied phdrs, throw away any + previous linker generated program headers. */ + if (lang_phdr_list == NULL) + elf_tdata (output_bfd)->segment_map = NULL; if (!_bfd_elf_map_sections_to_segments (output_bfd, &link_info)) einfo ("%F%P: map sections to segments failed: %E\n"); @@ -55,6 +61,10 @@ gld${EMULATION_NAME}_map_segments (bfd_boolean need_layout) lang_do_assignments (); need_layout = FALSE; + --tries; } + + if (tries == 0) + einfo (_("%P%F: looping in map_segments")); } EOF |