As addresses in the address tables may have relocations, thus, the relocations should be resolved to read the correct address. That is especially important for targets that use RELA relocations because in that case addends are stored in relocation sections.
Thanks, @jhenderson for spotting this!
I'm not sure I entirely follow why you go through the dance you are doing here? Why not just write the YAML directly?