core: add support for .init/fini_table
authorH. Peter Anvin <hpa@zytor.com>
Tue, 29 May 2012 04:39:40 +0000 (21:39 -0700)
committerH. Peter Anvin <hpa@zytor.com>
Tue, 29 May 2012 04:39:40 +0000 (21:39 -0700)
We don't actually have any constructors/destructors in the core at
this time, but handle .init/fini_table in case that happens...

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
core/syslinux.ld

index 40a0139..11adbcb 100644 (file)
@@ -280,8 +280,9 @@ SECTIONS
        __ctors_lma = __ctors_vma + __text_lma - __text_vma;
        .ctors : AT(__ctors_lma) {
                __ctors_start = .;
-               KEEP (*(SORT(.ctors.*)))
-               KEEP (*(.ctors))
+               KEEP (*(SORT(.preinit_array*)))
+               KEEP (*(SORT(.init_array*)))
+               KEEP (*(SORT(.ctors*)))
                __ctors_end = .;
        }
 
@@ -289,8 +290,8 @@ SECTIONS
        __dtors_lma = __dtors_vma + __text_lma - __text_vma;
        .dtors : AT(__dtors_lma) {
                __dtors_start = .;
-               KEEP (*(SORT(.dtors.*)))
-               KEEP (*(.dtors))
+               KEEP (*(SORT(.fini_array*)))
+               KEEP (*(SORT(.dtors*)))
                __dtors_end = .;
        }