2016-07-21 22:52 GMT+03:00 Ilya Kaliman <ilya.kali...@gmail.com>: > Found on 5.9 amd64, can reproduce on latest amd64 snapshot. > > How to reproduce: > > mkdir some_dir > ld some_dir > this creates a.out (which is strange by itself - > shouldn't it print the error?) > ldd a.out > core dumps
You do know what ldd does, don't you? It does run the binary you've just created. No wonder it coredumps, because it contains garbage. If you want to take a look on binary, use objdump (in particular, "objdump -p" when seeking for libraries - note, this will show only libraries used by the file you're investigating only, not every library that's loaded before main() being called), and not ldd. So just run "objdump -x a.out" on the binary you've created, and you'll see it's actually empty. Regarding ld... it just fails to fail properly when it encounters zero-size input. You'll get the same result with, e.g., /dev/null. Could you construct a patch for this? -- WBR, Vadim Zhukov