refractorised a bit, added option for excluding unwanted types of symbols, and added bss handling