fix Issue 11406 - ld.gold breaks switch table jumps

- This is due to the fact that gold doesn't add target
  addends to relocations (only uses the 64-bit rela addend).
refactor if-else branches

- remove some early returns and reuse common code
comment difference between 64 and 32 bit path
fix other occurences of the same bug
refactor ElfObj relocations

- Add writeaddrval with writes or appends an address
  value to a target segment at given offset.

- Add writerel which combines writing an address
  value and adding a relocation record.

- This allows to encapsulate the Rel/Rela
  difference between Elf32 and Elf64.
refactor obj_rtinit
refactor moduleinfo
refactor staticctor/staticdtor
refactor ehtables
refactor reftodataseg
refactor reftocodeseg
refactor reftoident
refactor cod3_buildmodulector