From 0f011fdcdf3a3e03c3d75f6df0176e58d2dfab97 Mon Sep 17 00:00:00 2001 From: Shankar Easwaran Date: Sun, 1 Feb 2015 03:21:57 +0000 Subject: [PATCH] [ELF] Set order of ctors/dtors section llvm-svn: 227707 --- lld/lib/ReaderWriter/ELF/DefaultLayout.h | 2 ++ lld/test/elf/Mips/ctors-order.test | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/lld/lib/ReaderWriter/ELF/DefaultLayout.h b/lld/lib/ReaderWriter/ELF/DefaultLayout.h index 9ebcf24..efd173c 100644 --- a/lld/lib/ReaderWriter/ELF/DefaultLayout.h +++ b/lld/lib/ReaderWriter/ELF/DefaultLayout.h @@ -363,6 +363,8 @@ Layout::SectionOrder DefaultLayout::getSectionOrder( .StartsWith(".init_array", ORDER_INIT_ARRAY) .StartsWith(".fini_array", ORDER_FINI_ARRAY) .StartsWith(".dynamic", ORDER_DYNAMIC) + .StartsWith(".ctors", ORDER_CTORS) + .StartsWith(".dtors", ORDER_DTORS) .Default(ORDER_DATA); case DefinedAtom::typeZeroFill: diff --git a/lld/test/elf/Mips/ctors-order.test b/lld/test/elf/Mips/ctors-order.test index 9c2d0d1..344dcd5 100644 --- a/lld/test/elf/Mips/ctors-order.test +++ b/lld/test/elf/Mips/ctors-order.test @@ -51,7 +51,7 @@ # CHECK-NEXT: section-name: .ctors # RAW: Contents of section .ctors: -# RAW-NEXT: 2000 ffffffff 11111111 22222222 00000000 +# RAW-NEXT: 1000 ffffffff 11111111 22222222 00000000 # crtbeginS.o --- FileHeader: -- 2.7.4