Rui Ueyama (2022-07-26T03:14:38.145019014+00:00) Permalink

Update (2022-07-25): David Chisnall points out that (at least) clang can process blobs-in-C-source-code faster if they're embedded as a string (but watch out for the null byte at the end!).

You can prevent the compiler from appending the null byte to an array by specifying the exact size of the array like this: https://godbolt.org/z/bGbae8x7W


MaskRay (2025-02-23T05:50:42.820827926+00:00) Permalink
Building binutils-gdb needs a default target. The default target can be utilized by objcopy -O default / ld.bfd --print-output-format

llvm-objcopy/lld encourage explicit target specification. You can use llvm-objcopy for all targets while GNU objcopy require aarch64-linux-gnu-objcopy/riscv64-linux-gnu-objcopy/etc.

but note that, for reasons unknown to me, hyphens have now become underscores

"elf_x86_64" (ld -m) is a bfd emulation, which is a ld shell script that generates a default linker script. Again, I think it is a design flaw to place target differences into the linker instead of the compiler driver. lld tries to implement the minimum set of emulations for Linux or generic ELF.