LLVM linker doesn't support discarding .shstrtab, and complains with:
ld -melf_i386_fbsd -N -T build32.lds -o reloc.lnk reloc.o
ld: error: discarding .shstrtab section is not allowed
Add an explicit .shstrtab, .strtab and .symtab sections to the linker
script after the text section in order to make LLVM LD happy and match
the behavior of GNU LD.
Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
Release-acked-by: Paul Durrant <paul@xen.org>
*(.got.plt)
}
+ /*
+ * Discarding .shstrtab is not supported by LLD (LLVM LD) and will trigger an
+ * error. Also keep the rest of the control sections to match GNU LD behavior.
+ */
+ .shstrtab : {
+ *(.shstrtab)
+ }
+ .strtab : {
+ *(.strtab)
+ }
+ .symtab : {
+ *(.symtab)
+ }
+
/DISCARD/ : {
/*
* Discard everything else, to prevent linkers from putting