Esempio n. 1
0
void MipsELFWriter<ELFT>::finalizeMipsRuntimeAtomValues() {
  if (!_ctx.isDynamic())
    return;

  auto gotSection = _targetLayout.findOutputSection(".got");
  auto got = gotSection ? gotSection->virtualAddr() : 0;
  auto gp = gotSection ? got + _targetLayout.getGPOffset() : 0;

  setAtomValue("_gp", gp);
  setAtomValue("_gp_disp", gp);
  setAtomValue("__gnu_local_gp", gp);
}
Esempio n. 2
0
void MipsELFWriter<ELFT>::finalizeMipsRuntimeAtomValues() {
  auto gotSection = _targetLayout.findOutputSection(".got");
  auto got = gotSection ? gotSection->virtualAddr() : 0;
  auto gp = gotSection ? got + _targetLayout.getGPOffset() : 0;

  setAtomValue("_gp", gp);
  setAtomValue("_gp_disp", gp);
  setAtomValue("__gnu_local_gp", gp);

  if (_ctx.isDynamic() && _ctx.getOutputELFType() == ET_EXEC)
    setAtomValue("_DYNAMIC_LINKING", 1);
}