On 02/08/2012 04:45 PM, Joseph S. Myers wrote:
That #else case looks wrong, you still need to call the function
(directly) in the non-weak case, and the final addq and ret should only be
in the epilogue in crtn.S, not in crti.S, so that all the other functions
other objects contribute to the .init section are called.
Fixed. Slightly tested on x86_64-redhat-linux. Ok?
2012-02-09 Marek Polacek<polacek@redhat.com>
* sysdeps/x86_64/crti.S: New file.
* sysdeps/x86_64/crtn.S: New file.
* sysdeps/x86_64/elf/initfini.c: Remove file.
--- libc/sysdeps/x86_64/crtn.S.mp 2012-02-08 15:33:53.221898023 +0100
+++ libc/sysdeps/x86_64/crtn.S 2012-02-09 16:05:17.704562797 +0100
@@ -0,0 +1,47 @@
+/* Special .init and .fini section support for x86-64.
+ Copyright (C) 2012 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Marek Polacek<polacek@redhat.com>, 2012.