diff options
| author | Thomas Preud'homme <robotux@celest.fr> | 2016-11-12 23:16:07 +0800 |
|---|---|---|
| committer | Thomas Preud'homme <robotux@celest.fr> | 2016-12-03 17:26:51 +0000 |
| commit | 1c811a4d1db56e4ed4fefa99ea39c679aa0c29f0 (patch) | |
| tree | 13775d557fedc7cd4c1922e39fa73ef58a7d0130 /x86_64-link.c | |
| parent | 523b55d82d455951659868d68eb54c4f5dbfb5a4 (diff) | |
| download | tinycc-1c811a4d1db56e4ed4fefa99ea39c679aa0c29f0.tar.gz tinycc-1c811a4d1db56e4ed4fefa99ea39c679aa0c29f0.tar.bz2 | |
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.
Diffstat (limited to 'x86_64-link.c')
| -rw-r--r-- | x86_64-link.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/x86_64-link.c b/x86_64-link.c index 2a9e9b0..5f8c504 100644 --- a/x86_64-link.c +++ b/x86_64-link.c @@ -2,6 +2,20 @@ #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_X86_64_64, 0, AUTO_GOTPLT_ENTRY, 0) + INIT_RELOC_INFO (R_X86_64_32, 0, AUTO_GOTPLT_ENTRY, 0) + INIT_RELOC_INFO (R_X86_64_32S, 0, AUTO_GOTPLT_ENTRY, 0) + INIT_RELOC_INFO (R_X86_64_PC32, 1, AUTO_GOTPLT_ENTRY, 0) + INIT_RELOC_INFO (R_X86_64_PLT32, 1, ALWAYS_GOTPLT_ENTRY, 1) + INIT_RELOC_INFO (R_X86_64_GLOB_DAT, 0, NO_GOTPLT_ENTRY, 0) + INIT_RELOC_INFO (R_X86_64_JUMP_SLOT, 1, NO_GOTPLT_ENTRY, 0) + INIT_RELOC_INFO (R_X86_64_GOTPCREL, 0, ALWAYS_GOTPLT_ENTRY, 0) + INIT_RELOC_INFO (R_X86_64_GOTPCRELX, 0, ALWAYS_GOTPLT_ENTRY, 0) + INIT_RELOC_INFO (R_X86_64_REX_GOTPCRELX, 0, ALWAYS_GOTPLT_ENTRY, 0) + INIT_RELOC_INFO (R_X86_64_GOTTPOFF, 0, BUILD_GOT_ONLY, 0) + INIT_RELOC_INFO (R_X86_64_GOT32, 0, ALWAYS_GOTPLT_ENTRY, 0) +}; void relocate_init(Section *sr) { |
