Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -35,28 +35,41 @@ SECTIONS

/* Need to pre-align so that the symbols come after padding */
. = ALIGN(8);
.init_array :
PROVIDE_HIDDEN ( __bothinit_array_start = . );
.preinit_array :
{
/* lists of constructors and destructors */
PROVIDE_HIDDEN ( __preinit_array_start = . );
PROVIDE_HIDDEN ( __bothinit_array_start = . );
KEEP (*(.preinit_array))
PROVIDE_HIDDEN ( __preinit_array_end = . );

PROVIDE_HIDDEN ( __init_array_start = . );
/* run .ctors first */
}
.ctors :
{
PROVIDE_HIDDEN ( __ctors_start = . );
KEEP (*( SORT_BY_INIT_PRIORITY(.ctors.*)))
KEEP (*(.ctors))
PROVIDE_HIDDEN ( __ctors_end = . );
}
.init_array :
{
PROVIDE_HIDDEN ( __init_array_start = . );
KEEP (*( SORT_BY_INIT_PRIORITY(.init_array.*)))
KEEP (*(.init_array .ctors))
KEEP (*(.init_array))
PROVIDE_HIDDEN ( __init_array_end = . );
PROVIDE_HIDDEN ( __bothinit_array_end = . );
}
PROVIDE_HIDDEN ( __bothinit_array_end = . );
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do we need these symbols bothinit_array_{start,end} ?


.dtors :
{
PROVIDE_HIDDEN ( __dtors_start = . );
KEEP (*(SORT_BY_INIT_PRIORITY(.dtors.*)))
KEEP (*(.dtors))
PROVIDE_HIDDEN ( __dtors_end = . );
}
.fini_array :
{
PROVIDE_HIDDEN ( __fini_array_start = . );
KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.*) SORT_BY_INIT_PRIORITY(.dtors.*)))
KEEP (*(.fini_array .dtors))
KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.*)))
KEEP (*(.fini_array))
KEEP (*(.fini_array*))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why this special handling ? Do we see .fini_array* ?

PROVIDE_HIDDEN ( __fini_array_end = . );
}
Expand Down
Loading