Revert "readdir: marked 'ld' as static to avoid returning stack garbage"

This reverts commit 7cbc29988b40531165a9356f21177559186f8c48.