Alex Bennee <alex.ben...@linaro.org> writes: >> Apologies for the unclear commit msg. I was also seeing a SIGSEGV in >> zero_bss() with the binaries I was generating. I was using LLD to generate >> the binaries. The binaries all had LOAD segments with a file size of >> 0. > > How hairy is the generation of these binaries? If it's all doable with > standard gcc/ldd command lines it would be useful to add them as a > tcg/multiarch test case.
We are linking with an old version of musl. I was able to produce an ELF with a LOAD segment just for the BSS with the following: volatile int num; int main(void) { return num; } and compiling it with just aarch64-linux-gnu-gcc -fuse-ld=lld -static and linking with cross compiled musl v1.1.9 on Ubuntu. I tried it with glibc and it has a bunch of non-BSS variables, so the data section gets created.