Fix a number of issues with section offsets and size calculations and add mapfile generation
Add mapfile output
Remove debug log