#include <sys/types.h>
#endif
+#include <inttypes.h>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
SymI_HasProto(signal_handlers) \
SymI_HasProto(stg_sig_install) \
SymI_HasProto(rtsTimerSignal) \
+ SymI_HasProto(atexit) \
SymI_NeedsProto(nocldstop)
#endif
}
IF_DEBUG(linker,
- debugBelch("relocateSection: length = %d, thing = %d, baseValue = %p\n",
- reloc->r_length, thing, baseValue));
+ debugBelch("relocateSection: length = %d, thing = %" PRId64 ", baseValue = %p\n",
+ reloc->r_length, thing, (char *)baseValue));
if (type == X86_64_RELOC_GOT
|| type == X86_64_RELOC_GOT_LOAD)
}
else
{
- value = sections[reloc->r_symbolnum-1].offset
- - sections[reloc->r_symbolnum-1].addr
- + (uint64_t) image;
+ // If the relocation is not through the global offset table
+ // or external, then set the value to the baseValue. This
+ // will leave displacements into the __const section
+ // unchanged (as they ought to be).
+
+ value = baseValue;
}
IF_DEBUG(linker, debugBelch("relocateSection: value = %p\n", (void *)value));