[PATCH] D35552: [ELF] - Fix init_fini_priority.s test.

George Rimar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 18 05:15:00 PDT 2017


grimar created this revision.
Herald added a subscriber: emaste.

Previous output of readelf for object file used in test was:

  [ 3] .init_array       INIT_ARRAY       0000000000000000  00000048
       0000000000000003  0000000000000000  WA       0     0     8
  [ 4] .init_array.100   INIT_ARRAY       0000000000000000  0000004b
       0000000000000004  0000000000000000  WA       0     0     1
  [ 5] .init_array.5     INIT_ARRAY       0000000000000000  0000004f
       0000000000000001  0000000000000000  WA       0     0     1

Problem is that .init_array sections were merged together.
I believe intention was different - test should show how separate
sections are correctly sorted. Patch makes such section to be unique.


https://reviews.llvm.org/D35552

Files:
  test/ELF/init_fini_priority.s


Index: test/ELF/init_fini_priority.s
===================================================================
--- test/ELF/init_fini_priority.s
+++ test/ELF/init_fini_priority.s
@@ -7,28 +7,28 @@
 _start:
   nop
 
-.section .init_array, "aw", @init_array
+.section .init_array, "aw", @init_array, unique, 0
   .align 8
   .byte 1
 .section .init_array.100, "aw", @init_array
   .long 2
 .section .init_array.5, "aw", @init_array
   .byte 3
-.section .init_array, "aw", @init_array
+.section .init_array, "aw", @init_array, unique, 1
   .byte 4
-.section .init_array, "aw", @init_array
+.section .init_array, "aw", @init_array, unique, 2
   .byte 5
 
-.section .fini_array, "aw", @fini_array
+.section .fini_array, "aw", @fini_array, unique, 0
   .align 8
   .byte 0x11
 .section .fini_array.100, "aw", @fini_array
   .long 0x12
 .section .fini_array.5, "aw", @fini_array
   .byte 0x13
-.section .fini_array, "aw", @fini_array
+.section .fini_array, "aw", @fini_array, unique, 1
   .byte 0x14
-.section .fini_array, "aw", @fini_array
+.section .fini_array, "aw", @fini_array, unique, 2
   .byte 0x15
 
 // CHECK:      Contents of section .init_array:


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D35552.107075.patch
Type: text/x-patch
Size: 1145 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170718/5b69b5c5/attachment.bin>


More information about the llvm-commits mailing list