From a60af0db8811f4ea6f5ac98322121ac541eb12e7 Mon Sep 17 00:00:00 2001 From: Doug Kwan Date: Fri, 24 Jun 2011 16:40:34 +0000 Subject: [PATCH] 2011-06-24 Doug Kwan * arm.cc (Arm_output_section::append_text_sections_to_list): Do not skip empty text sections. * testsuite/arm_exidx_test.s: Test handling of an empty text section. --- gold/ChangeLog | 6 ++++++ gold/arm.cc | 3 +-- gold/testsuite/arm_exidx_test.s | 15 ++++++++++++++- 3 files changed, 21 insertions(+), 3 deletions(-) diff --git a/gold/ChangeLog b/gold/ChangeLog index 7efbcddd81..1169f2739d 100644 --- a/gold/ChangeLog +++ b/gold/ChangeLog @@ -1,3 +1,9 @@ +2011-06-24 Doug Kwan + + * arm.cc (Arm_output_section::append_text_sections_to_list): Do not + skip empty text sections. + * testsuite/arm_exidx_test.s: Test handling of an empty text section. + 2011-06-22 Ian Lance Taylor PR gold/12910 diff --git a/gold/arm.cc b/gold/arm.cc index e36b3ab5d4..98e82b970e 100644 --- a/gold/arm.cc +++ b/gold/arm.cc @@ -5803,8 +5803,7 @@ Arm_output_section::append_text_sections_to_list( { // We only care about plain or relaxed input sections. We also // ignore any merged sections. - if ((p->is_input_section() || p->is_relaxed_input_section()) - && p->data_size() != 0) + if (p->is_input_section() || p->is_relaxed_input_section()) list->push_back(Text_section_list::value_type(p->relobj(), p->shndx())); } diff --git a/gold/testsuite/arm_exidx_test.s b/gold/testsuite/arm_exidx_test.s index e4f8c8b35f..14dcc9414f 100644 --- a/gold/testsuite/arm_exidx_test.s +++ b/gold/testsuite/arm_exidx_test.s @@ -1,12 +1,25 @@ .syntax unified .arch armv5te - .text + .section .text.answer,"ax",%progbits .align 2 .global answer .type answer, %function answer: .fnstart + .cantunwind mov r0, #42 bx lr .fnend .size answer, .-answer + +# Check that we can handle an empty .text section + .section .text.empty,"ax",%progbits + .align 2 + .global empty + .type empty, %function +empty: + .fnstart + .cantunwind + .fnend + .size empty, .-empty +