[SeaBIOS] [PATCH v4 3/4] romlayout32flag.lds: Use `. +=` instead of `. =`

2022-07-12 Thread Fangrui Song via SeaBIOS
This improves the portability of the linker script and allows lld to link rom.o Dot assignment inside an output section has an inconsistent behavior which makes lld difficult to implement. See https://bugs.llvm.org/show_bug.cgi?id=43083 Dropping `. =` turns out to be beneficial to older GNU ld

[SeaBIOS] [PATCH v4 2/4] Make rom16.o linkable with lld

2022-07-12 Thread Fangrui Song via SeaBIOS
lld requires output section descriptions to be sorted by address. Just sort the addresses beforehand. -- Changes v2 -> v3 * Sort sections by finalloc unconditionally Signed-off-by: Fangrui Song --- scripts/layoutrom.py | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/layoutrom.py

[SeaBIOS] [PATCH v4 4/4] test-build.sh: Delete unneeded LD capability test

2022-07-12 Thread Fangrui Song via SeaBIOS
The previous commit changed romlayout32flag.lds to use `. += ` instead of `. =`. We no longer need the LD capability test checking https://sourceware.org/bugzilla/show_bug.cgi?id=12726 Signed-off-by: Fangrui Song --- scripts/test-build.sh | 42 +- 1 file

[SeaBIOS] [PATCH v4 1/4] romlayout.S: Add missing SHF_ALLOC flag to .fixedaddr.\addr

2022-07-12 Thread Fangrui Song via SeaBIOS
It does not make sense to reference a SHF_ALLOC section from a non-SHF_ALLOC section via R_386_PC16. Conceptually, even if a non-SHF_ALLOC is loaded as part of the memory image, the distance between it and a SHF_ALLOC section may not be a constant, so the linker cannot reasonably resolve the

[SeaBIOS] [PATCH v4 0/4] Make seabios linkable with lld

2022-07-12 Thread Fangrui Song via SeaBIOS
Another try after https://mail.coreboot.org/hyperkitty/list/seabios@seabios.org/thread/KBHQU4OLW2THG5Q5F5X7EWTQDJHKNVYC/ The only change is the removal of `Makefile: Change ET_EXEC to ET_REL so that lld can link bios.bin.elf` since 699a4e5d6919cc8eae5342443025ceb6909dc276 ("ldnoexec: Add script

[SeaBIOS] [PATCH v3] Replace $(OBJDUMP) -thr with $(READELF) -WSrs

2022-07-12 Thread Fangrui Song via SeaBIOS
objdump -h relies heavily on BFD internals and the BFD flags. The output is difficult to emulate in llvm-objdump. (llvm-objdump -h has a different output https://reviews.llvm.org/D57146). Switch to READELF, so that llvm-readelf can be used as an alternative. readelf is generally better than

[SeaBIOS] Re: [PATCH v3] Replace $(OBJDUMP) -thr with $(READELF) -WSrs

2022-07-13 Thread Fangrui Song via SeaBIOS
On Wed, Jul 13, 2022 at 10:01 PM Paul Menzel wrote: > > Dear Fangrui, > > > Thank you for the patch. > > Am 13.07.22 um 04:37 schrieb Fangrui Song via SeaBIOS: > > objdump -h relies heavily on BFD internals and the BFD flags. The output > > is difficult to emula