diff --git a/BaseTools/Scripts/GccBase.lds b/BaseTools/Scripts/GccBase.lds index f0d8f3ff5..e81450543 100755 --- a/BaseTools/Scripts/GccBase.lds +++ b/BaseTools/Scripts/GccBase.lds @@ -45,18 +45,15 @@ SECTIONS { .data ALIGN(ALIGNOF(.text)) : ALIGN(CONSTANT(COMMONPAGESIZE)) { *(.data .data.* .gnu.linkonce.d.*) *(.bss .bss.*) + __beginning_of_section_ctors = .; /* create symbol for start of section */ + KEEP(*(.ctors .init_array)) /* .ctors is used on macOS, .init_array on Linux */ + __end_of_section_ctors = .; /* create symbol for end of section */ } .eh_frame ALIGN(CONSTANT(COMMONPAGESIZE)) : { KEEP (*(.eh_frame)) } - .ctorss ALIGN(CONSTANT(COMMONPAGESIZE)) : { - __beginning_of_section_ctors = .; /* create symbol for start of section */ - KEEP (*(.ctors)) - __end_of_section_ctors = .; /* create symbol for end of section */ - } - .rela (INFO) : { *(.rela .rela.*) }