Prevent deletion of .reloc by gc-sections

Add keyword KEEP to prevent .reloc being removed
when using --gc-sections with GNU ld

Signed-off-by: Callum Farmer <gmbr3@opensuse.org>
This commit is contained in:
Callum Farmer 2023-03-22 15:30:04 +00:00
parent 0f9c15fe4f
commit bc233a7a4b
4 changed files with 4 additions and 4 deletions

View File

@ -26,7 +26,7 @@ SECTIONS
. = ALIGN(4096);
.reloc :
{
*(.reloc)
KEEP (*(.reloc))
}
. = ALIGN(65536);
.dynamic : { *(.dynamic) }

View File

@ -75,7 +75,7 @@ SECTIONS
. = ALIGN(4096);
.reloc : /* This is the PECOFF .reloc section! */
{
*(.reloc)
KEEP (*(.reloc))
}
. = ALIGN(4096);
.dynsym : { *(.dynsym) }

View File

@ -70,7 +70,7 @@ SECTIONS
. = ALIGN(4096);
.reloc : /* This is the PECOFF .reloc section! */
{
*(.reloc)
KEEP (*(.reloc))
}
. = ALIGN(4096);
.dynsym : { *(.dynsym) }

View File

@ -26,7 +26,7 @@ SECTIONS
. = ALIGN(4096);
.reloc :
{
*(.reloc)
KEEP (*(.reloc))
}
. = ALIGN(4096);
.data :