[PATCH] D25467: [ELF] - Alternative fix to prevent possible crash on large output.

Brad Smith via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 24 18:27:48 PDT 2016


On 10/17/16 17:26, Rui Ueyama via llvm-commits wrote:
>  - OpenBSD: it is reported that the current LLD doesn't work well on
> their operating system.

With the recent work on the linker script support I can now link an 
OpenBSD/amd64 kernel. But it isn't bootable. It fails early on in what
looks like the boot blocks loading the kernel.

Binaries can be linked but crash. Shared libs would probably be broken 
too. The PIE handling needs to be fixed.

Also another issue I just noticed when trying to link our boot 
blocks/loader and such..

ld.lld -nostdlib -Ttext 0 -x -s -Bstatic -e start -nopie -melf_i386 
-L/usr/libdata -o mbr mbr.o
ld.lld: error: cannot open text: No such file or directory
ld.lld: error: cannot open 0: No such file or directory

ld.lld -nostdlib -Ttext 0x0000 -x -s -Bstatic -e start -nopie -melf_i386 
-L/usr/libdata -o cdbr cdbr.o
ld.lld: error: cannot open text: No such file or directory
ld.lld: error: cannot open 0x0000: No such file or directory

ld.lld  -nostdlib -Bstatic -Ttext 0x40120 -N -x -nopie -melf_i386 
-L/usr/libdata -o boot.new srt0.o conf.o boot.o bootarg.o cmd.o vars.o 
gidt.o random_i386.o cmd_i386.o dev_i386.o exec_i386.o gateA20.o 
machdep.o bioscons.o biosdev.o diskprobe.o memprobe.o time.o softraid.o 
alloc.o ctime.o exit.o getchar.o memcmp.o memcpy.o memset.o printf.o 
putchar.o snprintf.o strcmp.o strerror.o strlen.o strncmp.o strncpy.o 
strtol.o strtoll.o close.o closeall.o cons.o cread.o dev.o disklabel.o 
dkcksum.o fstat.o lseek.o open.o read.o readdir.o stat.o elf32.o elf64.o 
loadfile.o ufs.o aes_xts.o explicit_bzero.o hmac_sha1.o pbkdf2.o 
rijndael.o sha1.o divdi3.o moddi3.o qdivrem.o strlcpy.o adler32.o 
crc32.o inflate.o inftrees.o
ld.lld: error: cannot open text: No such file or directory
ld.lld: error: cannot open 0x40120: No such file or directory


More information about the llvm-commits mailing list