http://llvm.org/bugs/show_bug.cgi?id=11322
Bug #: 11322
Summary: Wrong constructor order for ARM/ELF
Product: libraries
Version: trunk
Platform: PC
OS/Version: Linux
Status: NEW
Severity: normal
Priority: P
Component: Backend: ARM
AssignedTo: [email protected]
ReportedBy: [email protected]
CC: [email protected]
Classification: Unclassified
ARM/ELF uses .init_array section for constructors. Unlike .ctors section,
.init_array is executed in _forward_ order. LLVM does not take this into
account. As a result, constructors on ARM/ELF are executed in _reverse_
priority order.
Reproducer:
cat >1.c
__attribute__((constructor(152))) void f152() {}
__attribute__((constructor(151))) void f151() {}
^D
./Release+Asserts/bin/clang -ccc-host-triple arm-elf-linux-gnueabi 1.c -S
cat 1.S
... # unrelated output skipped
.section .init_array,"aw",%init_array
.align 2
.long f152
.long f151
--
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs