freebsd-dev/stand
Dimitry Andric a2037dba7e Link stand/i386 components using a linker script
LLD 10.0.0 changed the behavior of the -Ttext option, so that using
-Ttext=0x0 now causes linking of the loaders to fail with:

ld: error: output file too large: 18446744073707016908 bytes

I reported this in https://bugs.llvm.org/show_bug.cgi?id=44715, and
initially reverted the upstream change in r357259 to work around it.

However, after some discussion with Fangrui Song in the upstream ticket,
I think we can classify this as an unfortunate interaction between using
-Ttext=0 in combination with --no-rosegment.  (We added the latter
in r332090, because btxld does not correctly handle input with more
than 2 PT_LOAD segments.)

Fangrui suggested to use a linker script instead, and Warner was already
attempting this in r305353, but had to revert it due to "crypto-using
boot problems" (not sure what those were :).

This review updates the stand/i386/boot.ldscript to handle more
sections, inserts some symbols like _edata and such that we use in
libsa, and also discards any .interp section.

It uses ORG which is defined on the linker command line using
--defsym ORG=value to set the start of all the sections.

Reviewed by:	imp
MFC after:	2 weeks
Differential Revision: https://reviews.freebsd.org/D23952
2020-03-04 21:01:22 +00:00
..
arm
arm64
common loader: alloc_pread() should set errno if malloc fails 2020-02-23 15:21:15 +00:00
defaults
efi efi_register_handles() is missing NULL pointer check 2020-02-20 09:02:59 +00:00
fdt stand/fdt: Scale blob size better as overlays apply 2020-01-09 04:34:42 +00:00
ficl Remove sparc64 support from the boot loader. 2020-02-03 17:34:57 +00:00
ficl32
forth loader_4th: menu items need to reset color attribute, not switch to white 2019-09-22 16:10:25 +00:00
i386 Link stand/i386 components using a linker script 2020-03-04 21:01:22 +00:00
kshim
liblua stand: liblua: drop default buffer size to 128 2019-12-12 01:35:56 +00:00
liblua32
libofw Remove sparc64 support from the boot loader. 2020-02-03 17:34:57 +00:00
libsa loader: replace zfs_alloc/zfs_free with malloc/free 2020-02-26 18:12:12 +00:00
libsa32
lua lua: add modules.loaded hook 2020-01-25 03:52:16 +00:00
man Remove sparc64 support from the boot loader. 2020-02-03 17:34:57 +00:00
mips
powerpc [PowerPC] Fix LLD10 linking of ofw loader on ppc 2020-02-25 00:45:09 +00:00
uboot Backout 356693. The libsa malloc does provide necessary alignment and 2020-01-13 20:02:27 +00:00
usb Fix build of stand/usb . 2020-01-23 10:40:34 +00:00
userboot loader: userboot/test should accept more than one disk 2019-11-03 09:14:29 +00:00
defs.mk Move stand/ofw/libofw to stand/libofw. 2020-01-02 04:34:22 +00:00
fdt.mk
ficl.mk
loader.mk Remove sparc64 support from the boot loader. 2020-02-03 17:34:57 +00:00
lua.mk
Makefile Move stand/ofw/libofw to stand/libofw. 2020-01-02 04:34:22 +00:00
Makefile.amd64
Makefile.inc
uboot.mk