2011-06-24 Doug Kwan <dougkwan@google.com>
authorDoug Kwan <dougkwan@google.com>
Fri, 24 Jun 2011 16:40:34 +0000 (16:40 +0000)
committerDoug Kwan <dougkwan@google.com>
Fri, 24 Jun 2011 16:40:34 +0000 (16:40 +0000)
* 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
gold/arm.cc
gold/testsuite/arm_exidx_test.s

index 7efbcddd816ee50266637a9bb065532e7545293d..1169f2739d898124e1c84b86320ef6e67db45efe 100644 (file)
@@ -1,3 +1,9 @@
+2011-06-24  Doug Kwan  <dougkwan@google.com>
+
+       * 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  <iant@google.com>
 
        PR gold/12910
index e36b3ab5d40c71660ed72b62fe07e178a1aafc8c..98e82b970e7f6281cddcc5d2d65f95bda3068186 100644 (file)
@@ -5803,8 +5803,7 @@ Arm_output_section<big_endian>::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()));
     }
index e4f8c8b35f04e2c152a1001e0217213474ab1e60..14dcc9414f8536e740ae412ee33b9d8274bdde51 100644 (file)
@@ -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
+
This page took 0.037006 seconds and 4 git commands to generate.