From 1c811a4d1db56e4ed4fefa99ea39c679aa0c29f0 Mon Sep 17 00:00:00 2001 From: Thomas Preud'homme Date: Sat, 12 Nov 2016 23:16:07 +0800 Subject: Make build_got_entries more target independent Factor most of common logic between targets in build_got_entries by defining target specific info into structures in the backends. --- i386-link.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'i386-link.c') diff --git a/i386-link.c b/i386-link.c index b33882f..019b53f 100644 --- a/i386-link.c +++ b/i386-link.c @@ -2,6 +2,19 @@ #define HAVE_SECTION_RELOC static ElfW_Rel *qrel; /* ptr to next reloc entry reused */ +ST_DATA struct reloc_info relocs_info[] = { + INIT_RELOC_INFO (R_386_32, 0, NO_GOTPLT_ENTRY, 0) + INIT_RELOC_INFO (R_386_PC32, 1, AUTO_GOTPLT_ENTRY, 0) + INIT_RELOC_INFO (R_386_PLT32, 1, ALWAYS_GOTPLT_ENTRY, 0) + INIT_RELOC_INFO (R_386_GLOB_DAT, 0, NO_GOTPLT_ENTRY, 0) + INIT_RELOC_INFO (R_386_JMP_SLOT, 1, NO_GOTPLT_ENTRY, 0) + INIT_RELOC_INFO (R_386_GOTPC, 0, BUILD_GOT_ONLY, 0) + INIT_RELOC_INFO (R_386_GOTOFF, 0, BUILD_GOT_ONLY, 0) + INIT_RELOC_INFO (R_386_GOT32, 0, ALWAYS_GOTPLT_ENTRY, 0) + INIT_RELOC_INFO (R_386_GOT32X, 0, ALWAYS_GOTPLT_ENTRY, 0) + INIT_RELOC_INFO (R_386_16, 0, NO_GOTPLT_ENTRY, 0) + INIT_RELOC_INFO (R_386_PC16, 1, AUTO_GOTPLT_ENTRY, 0) +}; void relocate_init(Section *sr) { -- cgit v1.3.1