History log of /haiku/src/system/ldscripts/sparc/boot_loader_openfirmware.ld
Revision Date Author Comments
# 076b1902 01-Jul-2019 Adrien Destugues <pulkomandy@pulkomandy.tk>

elf2aout: import from FreeBSD

The sparc openboot implementation can run executables in the a.out
format. We used to generate these using objcopy, but this does not work
anymore as binutils is deprecating a.out format support.

- Import elf2aout from FreeBSD
- Add some missing bits to our elf.h and have a copy of it in the build
headers so it can be used to build elf2aout for the host platform
(tested for Linux)
- Use it to generate the sparc haiku_loader
- Adjust the bootloader linker script to have two "program headers": one
that is not loadable and contains the ELF headers, and the second one
that is loadable and contains the actual code and data. Unlike
objcopy, elf2aout relies only on the program headers to know what to
put in its output file (sections are ignored), so this is required
otherwise we end up with the ELF header nested inside the a.out file,
and everything offset from the expected load address as a result.

Confirmed that this allows to build the loader and run it as far as
before, so I'm back to needing to implement some MMU support now.

FreeBSD commit: 7551d83c353e040b32c6ac205e577dbc5f2c8955

Change-Id: I90b48e578fa7f148aeddd8c5998fdddc5cfa73fa
Reviewed-on: https://review.haiku-os.org/c/1557
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>


# 864a3f99 20-May-2019 PulkoMandy <pulkomandy@pulkomandy.tk>

sparc: do not leave a hole between .text and .data

The a.out format does not allow to handle this properly. So we need the
two sections to be contiguous.

Change-Id: I44455d4fb728bd47d5dcebc48c52b7d90d808104
Reviewed-on: https://review.haiku-os.org/c/1469
Reviewed-by: waddlesplash <waddlesplash@gmail.com>


# 94ba4f64 10-Apr-2019 PulkoMandy <pulkomandy@pulkomandy.tk>

sparc: fix bootloader executable format

- The entry point has to be at the start of the text section
- Use the correct formqt ("impure") for the a.out file
- Strip all symbols (the bootloader isn't relocatable)

Change-Id: I2b973c39eaf1416f874bf1b2668b1e3090eb5f7b
Reviewed-on: https://review.haiku-os.org/c/1468
Reviewed-by: waddlesplash <waddlesplash@gmail.com>


# e8f58ba4 28-Mar-2019 PulkoMandy <pulkomandy@pulkomandy.tk>

sparc: fix bootloader build

- Add various missing jamfiles
- Add required implementation stubs
- Update openfirmware jamfiles for multiboot support
- Update linker rules for sparc loader

Change-Id: I2d06c7a4d33827f58d82946687003f9a0dcb1b7d
Reviewed-on: https://review.haiku-os.org/c/1329
Reviewed-by: waddlesplash <waddlesplash@gmail.com>