mirror of
https://github.com/opnsense/src.git
synced 2026-02-19 02:30:08 -05:00
kernel: Add defination of .init_array and .fini_array for all other platforms
Currently these sections are not used but defined only for amd64 and i386. Added them for all other platforms to keep all platforms in sync. There should be no functional change. This change is extracted from a bigger patch [1] of hselasky, with additional fix for the order of .fini_array section. 1. https://reviews.freebsd.org/D40467 Obtained from: hselasky MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D45214 (cherry picked from commit 3e76d05231b0aa77d922bdbc9abf62d9747a91ab)
This commit is contained in:
parent
1d94490aee
commit
bb5f701614
7 changed files with 98 additions and 6 deletions
|
|
@ -83,6 +83,20 @@ SECTIONS
|
|||
}
|
||||
.data1 : { *(.data1) }
|
||||
. = ALIGN(32 / 8);
|
||||
.init_array :
|
||||
{
|
||||
PROVIDE_HIDDEN (__init_array_start = .);
|
||||
KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*)))
|
||||
KEEP (*(.init_array))
|
||||
PROVIDE_HIDDEN (__init_array_end = .);
|
||||
}
|
||||
.fini_array :
|
||||
{
|
||||
PROVIDE_HIDDEN (__fini_array_start = .);
|
||||
KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.*)))
|
||||
KEEP (*(.fini_array))
|
||||
PROVIDE_HIDDEN (__fini_array_end = .);
|
||||
}
|
||||
_start_ctors = .;
|
||||
PROVIDE (start_ctors = .);
|
||||
.ctors :
|
||||
|
|
|
|||
|
|
@ -98,6 +98,20 @@ SECTIONS
|
|||
. = ALIGN(128);
|
||||
.data1 : { *(.data1) }
|
||||
. = ALIGN(32 / 8);
|
||||
.init_array :
|
||||
{
|
||||
PROVIDE_HIDDEN (__init_array_start = .);
|
||||
KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*)))
|
||||
KEEP (*(.init_array))
|
||||
PROVIDE_HIDDEN (__init_array_end = .);
|
||||
}
|
||||
.fini_array :
|
||||
{
|
||||
PROVIDE_HIDDEN (__fini_array_start = .);
|
||||
KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.*)))
|
||||
KEEP (*(.fini_array))
|
||||
PROVIDE_HIDDEN (__fini_array_end = .);
|
||||
}
|
||||
_start_ctors = .;
|
||||
PROVIDE (start_ctors = .);
|
||||
.ctors :
|
||||
|
|
|
|||
|
|
@ -79,8 +79,20 @@ SECTIONS
|
|||
. = ALIGN(4096);
|
||||
.got : { *(.got) }
|
||||
.got.plt : { *(.got.plt) }
|
||||
|
||||
|
||||
.init_array :
|
||||
{
|
||||
PROVIDE_HIDDEN (__init_array_start = .);
|
||||
KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*)))
|
||||
KEEP (*(.init_array))
|
||||
PROVIDE_HIDDEN (__init_array_end = .);
|
||||
}
|
||||
.fini_array :
|
||||
{
|
||||
PROVIDE_HIDDEN (__fini_array_start = .);
|
||||
KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.*)))
|
||||
KEEP (*(.fini_array))
|
||||
PROVIDE_HIDDEN (__fini_array_end = .);
|
||||
}
|
||||
.dynamic : { *(.dynamic) } :kernel :dynamic
|
||||
/* Put .ctors and .dtors next to the .got2 section, so that the pointers
|
||||
get relocated with -mrelocatable. Also put in the .fixup pointers.
|
||||
|
|
|
|||
|
|
@ -105,7 +105,20 @@ SECTIONS
|
|||
. = ALIGN(4096);
|
||||
.got : ALIGN(8) { __tocbase = .; *(.got) }
|
||||
.toc : ALIGN(8) { *(.toc) }
|
||||
|
||||
.init_array :
|
||||
{
|
||||
PROVIDE_HIDDEN (__init_array_start = .);
|
||||
KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*)))
|
||||
KEEP (*(.init_array))
|
||||
PROVIDE_HIDDEN (__init_array_end = .);
|
||||
}
|
||||
.fini_array :
|
||||
{
|
||||
PROVIDE_HIDDEN (__fini_array_start = .);
|
||||
KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.*)))
|
||||
KEEP (*(.fini_array))
|
||||
PROVIDE_HIDDEN (__fini_array_end = .);
|
||||
}
|
||||
.dynamic : { *(.dynamic) } :kernel :dynamic
|
||||
/* Put .ctors and .dtors next to the .got2 section, so that the pointers
|
||||
get relocated with -mrelocatable. Also put in the .fixup pointers.
|
||||
|
|
|
|||
|
|
@ -104,7 +104,20 @@ SECTIONS
|
|||
. = ALIGN(4096);
|
||||
.got : ALIGN(8) { __tocbase = .; *(.got) }
|
||||
.toc : ALIGN(8) { *(.toc) }
|
||||
|
||||
.init_array :
|
||||
{
|
||||
PROVIDE_HIDDEN (__init_array_start = .);
|
||||
KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*)))
|
||||
KEEP (*(.init_array))
|
||||
PROVIDE_HIDDEN (__init_array_end = .);
|
||||
}
|
||||
.fini_array :
|
||||
{
|
||||
PROVIDE_HIDDEN (__fini_array_start = .);
|
||||
KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.*)))
|
||||
KEEP (*(.fini_array))
|
||||
PROVIDE_HIDDEN (__fini_array_end = .);
|
||||
}
|
||||
.dynamic : { *(.dynamic) } :text :dynamic
|
||||
/* Put .ctors and .dtors next to the .got2 section, so that the pointers
|
||||
get relocated with -mrelocatable. Also put in the .fixup pointers.
|
||||
|
|
|
|||
|
|
@ -80,8 +80,20 @@ SECTIONS
|
|||
. = ALIGN(4096);
|
||||
.got : { *(.got) }
|
||||
.got.plt : { *(.got.plt) }
|
||||
|
||||
|
||||
.init_array :
|
||||
{
|
||||
PROVIDE_HIDDEN (__init_array_start = .);
|
||||
KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*)))
|
||||
KEEP (*(.init_array))
|
||||
PROVIDE_HIDDEN (__init_array_end = .);
|
||||
}
|
||||
.fini_array :
|
||||
{
|
||||
PROVIDE_HIDDEN (__fini_array_start = .);
|
||||
KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.*)))
|
||||
KEEP (*(.fini_array))
|
||||
PROVIDE_HIDDEN (__fini_array_end = .);
|
||||
}
|
||||
.dynamic : { *(.dynamic) } :kernel :dynamic
|
||||
/* Put .ctors and .dtors next to the .got2 section, so that the pointers
|
||||
get relocated with -mrelocatable. Also put in the .fixup pointers.
|
||||
|
|
|
|||
|
|
@ -71,6 +71,20 @@ SECTIONS
|
|||
}
|
||||
.data1 : { *(.data1) }
|
||||
. = ALIGN(32 / 8);
|
||||
.init_array :
|
||||
{
|
||||
PROVIDE_HIDDEN (__init_array_start = .);
|
||||
KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*)))
|
||||
KEEP (*(.init_array))
|
||||
PROVIDE_HIDDEN (__init_array_end = .);
|
||||
}
|
||||
.fini_array :
|
||||
{
|
||||
PROVIDE_HIDDEN (__fini_array_start = .);
|
||||
KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.*)))
|
||||
KEEP (*(.fini_array))
|
||||
PROVIDE_HIDDEN (__fini_array_end = .);
|
||||
}
|
||||
_start_ctors = .;
|
||||
PROVIDE (start_ctors = .);
|
||||
.ctors :
|
||||
|
|
|
|||
Loading…
Reference in a new issue