From afd7a018c9e949ee9f1126ae4517567bd9d2dcb1 Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Thu, 14 Oct 2004 12:54:47 +0000 Subject: ld/ PR 63 * ldlang.h (lang_output_section_statement_type): Make "next" a struct lang_output_section_statement_struct *. (struct orphan_save): Move from elf32.em. Add "name" and "flags". (lang_output_section_find_by_flags, lang_insert_orphan): Declare. * ldlang.c (lang_output_section_find_1): Adjust for changed output_section_statement "next". (strip_excluded_output_sections): Likewise. (lang_record_phdrs): Likewise. (lang_output_section_find_by_flags): New function. (output_prev_sec_find): Move from pe.em. Adjust iterator. (lang_insert_orphan): New function. Tail end of elf32.em's place_orphan merged with that from pe.em. Allow bfd_section to be placed first. New heuristic for placing new output section statement in existing script, and accompanying split of __start symbol alignment into a separate assignment to dot. (lang_add_section): Consistently use output->bfd_section rather than an alias, section->output_section. (map_input_to_output_sections): Rename overly long arg. Move initialization of data_statement output section to here.. (lang_check_section_addresses): ..from here. (print_assignment): Correct printing of etree_assert. (print_all_symbols): Don't bomb if userdata is NULL. (IGNORE_SECTION): Rearrange. * emultempl/elf32.em (output_rel_find): Adjust interator. (output_prev_sec_find): Delete. (struct orphan_save): Delete. (gld${EMULATION_NAME}_place_orphan): Cater for zero bfd_section flags without creating a duplicate output section statement. Revise code holding history of various orphan section placements. Allow orphan sections to place before script specified output sections. Call lang_output_section_find_by_flags when placement by name fails. Use lang_insert_orphan. * emultempl/mmo.em (output_prev_sec_find): Delete. (struct orphan_save): Delete. (mmo_place_orphan): Revise code holding history of orphan placement. Allow orphans to place before existing output sections. Use lang_insert_orphan. * emultempl/pe.em (output_prev_sec_find): Delete. (struct orphan_save): Delete. (gld_${EMULATION_NAME}_place_orphan): Revise to suit use of lang_insert_orphan. ld/testsuite/ * ld-scripts/overlay-size.d: Update for changed orphan section placement. * ld-mmix/bpo-18.d: Likewise. --- ld/testsuite/ChangeLog | 6 ++++++ ld/testsuite/ld-mmix/bpo-18.d | 4 ++-- ld/testsuite/ld-scripts/overlay-size.d | 22 +++++++++++----------- 3 files changed, 19 insertions(+), 13 deletions(-) (limited to 'ld/testsuite') diff --git a/ld/testsuite/ChangeLog b/ld/testsuite/ChangeLog index da6dc8a..f9a8bd5 100644 --- a/ld/testsuite/ChangeLog +++ b/ld/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2004-10-14 Alan Modra + + * ld-scripts/overlay-size.d: Update for changed orphan section + placement. + * ld-mmix/bpo-18.d: Likewise. + 2004-10-07 Bob Wilson * ld-xtensa/lcall1.s: Use .literal directive. diff --git a/ld/testsuite/ld-mmix/bpo-18.d b/ld/testsuite/ld-mmix/bpo-18.d index 39c9282..9a88569 100644 --- a/ld/testsuite/ld-mmix/bpo-18.d +++ b/ld/testsuite/ld-mmix/bpo-18.d @@ -12,9 +12,9 @@ SYMBOL TABLE: 0+100 l d \.text 0+ 4000000000001060 l d \.text\.away 0+ +400000000000106c l d \.data 0+ +400000000000106c l d \.bss 0+ 0+7e0 l d \.MMIX\.reg_contents 0+ -4000000000001088 l d \.data 0+ -4000000000001088 l d \.bss 0+ 0+ l d \*ABS\* 0+ 0+ l d \*ABS\* 0+ 0+ l d \*ABS\* 0+ diff --git a/ld/testsuite/ld-scripts/overlay-size.d b/ld/testsuite/ld-scripts/overlay-size.d index f54f56d..9021aa4 100644 --- a/ld/testsuite/ld-scripts/overlay-size.d +++ b/ld/testsuite/ld-scripts/overlay-size.d @@ -5,25 +5,25 @@ # The .bss[123] LMAs are deliberately blanked out. We can't # reliably map overlaid sections to segments. #... - 0 \.bss1 +0+010 +0+20000 .* + .. \.bss1 +0+010 +0+20000 .* #... - 1 \.bss2 +0+030 +0+20000 .* + .. \.bss2 +0+030 +0+20000 .* #... - 2 \.bss3 +0+020 +0+20000 .* + .. \.bss3 +0+020 +0+20000 .* #... - 3 \.mtext +0+020 +0+10000 +0+30000 .* + .. \.mtext +0+020 +0+10000 +0+30000 .* #... - 4 \.mbss +0+230 +0+20030 .* + .. \.mbss +0+230 +0+20030 .* #... - 5 \.text1 +0+080 +0+10020 +0+30020 .* + .. \.text1 +0+080 +0+10020 +0+30020 .* #... - 6 \.text2 +0+040 +0+10020 +0+300a0 .* + .. \.text2 +0+040 +0+10020 +0+300a0 .* #... - 7 \.text3 +0+020 +0+10020 +0+300e0 .* + .. \.text3 +0+020 +0+10020 +0+300e0 .* #... - 8 \.data1 +0+030 +0+20260 +0+30100 .* + .. \.data1 +0+030 +0+20260 +0+30100 .* #... - 9 \.data2 +0+040 +0+20260 +0+30130 .* + .. \.data2 +0+040 +0+20260 +0+30130 .* #... - 10 \.data3 +0+050 +0+20260 +0+30170 .* + .. \.data3 +0+050 +0+20260 +0+30170 .* #pass -- cgit v1.1