binutils-gdb icon indicating copy to clipboard operation
binutils-gdb copied to clipboard

ELIMINATE_COPY_RELOCS

Open pipcet opened this issue 8 years ago • 0 comments

Ports like x86-64 set ELIMINATE_COPY_RELOCS, which I think does the following:

  • there's a non-GOT relocation to a data symbol defined in a shared library
  • ordinarily, that would mean creating a copy reloc
  • but all such relocations are in read-only sections, so we know the symbol data wouldn't be modified through the non-GOT relocations, so we skip the entire procedure and relocate to the copy of the symbol in the shared library instead.

Considering we don't even have read-only memory, I'm not going to implement this mere optimization for now. Unless I'm wrong and it isn't an optimization, but required for correctness somehow.

pipcet avatar Mar 14 '17 19:03 pipcet