by rbsmith · 4y ago · 0 comments
for cc in cc gcc clang
do echo "## $cc"
$cc -no-pie -static -nostdlib -o blc -Wl,--oformat=binary blc.S || exit 1
{ printf 0010; printf 0101; } | ./blc; echo
done
Any suggestions? wget https://justine.lol/lambda/blc.S
wget https://justine.lol/lambda/flat.lds
cc -c -o blc.o blc.S
ld.bfd -o blc blc.o -T flat.lds
Just tested myself on Linux with both GCC and Clang. Whatever you do, do not use any linker except big deal.