History

Error on unrecognized relocations

Thomas Preud'homme committed 9 years ago

Commit e22249b1 parent 557c5c12 files · +6 −1Browse files

Unified · Split

2 files
  1. tcc.h +2 −1
  2. tccelf.c +4 −0
tcc.h+2−1
@@ -1323,13 +1323,14 @@ enum gotplt_entry { · 1322 unmodified lines
1323 1323
1324/* what kind of relocation is it */1324/* what kind of relocation is it */
1325struct reloc_info {1325struct reloc_info {
1326 int known; /* true for known relocation */
1326 int code_reloc; /* if false, that's a data reloc */1327 int code_reloc; /* if false, that's a data reloc */
1327 int gotplt_entry; /* wether and when to create a GOT/PLT entry */1328 int gotplt_entry; /* wether and when to create a GOT/PLT entry */
1328 int pltoff_addend; /* wether to store the PLT offset in addend */1329 int pltoff_addend; /* wether to store the PLT offset in addend */
1329};1330};
1330 1331
1331#define INIT_RELOC_INFO(rtype, code_reloc, gotplt_entry, pltoff_addend) \1332#define INIT_RELOC_INFO(rtype, code_reloc, gotplt_entry, pltoff_addend) \
1332 [rtype] = {code_reloc, gotplt_entry, pltoff_addend},1333 [rtype] = {1, code_reloc, gotplt_entry, pltoff_addend},
1333ST_DATA struct reloc_info relocs_info[R_NUM];1334ST_DATA struct reloc_info relocs_info[R_NUM];
1334 1335
1335ST_DATA Section *text_section, *data_section, *bss_section; /* predefined sections */1336ST_DATA Section *text_section, *data_section, *bss_section; /* predefined sections */
tccelf.c+4−0
@@ -1042,6 +1042,10 @@ ST_FUNC void build_got_entries(TCCState *s1) · 1041 unmodified lines
1042 type = ELFW(R_TYPE)(rel->r_info);1042 type = ELFW(R_TYPE)(rel->r_info);
1043 sym_index = ELFW(R_SYM)(rel->r_info);1043 sym_index = ELFW(R_SYM)(rel->r_info);
1044 sym = &((ElfW(Sym) *)symtab_section->data)[sym_index];1044 sym = &((ElfW(Sym) *)symtab_section->data)[sym_index];
1045
1046 if (type >= R_NUM || !relocs_info[type].known)
1047 tcc_error("Unknown relocation: %d\n", type);
1048
1045 if (relocs_info[type].gotplt_entry == NO_GOTPLT_ENTRY)1049 if (relocs_info[type].gotplt_entry == NO_GOTPLT_ENTRY)
1046 continue;1050 continue;
1047 1051

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t