diff options
| author | Thomas Preud'homme <robotux@celest.fr> | 2016-12-05 20:58:00 +0000 |
|---|---|---|
| committer | Thomas Preud'homme <robotux@celest.fr> | 2016-12-05 20:58:00 +0000 |
| commit | e22249b81c367afc43bbc8029e700964c21900ce (patch) | |
| tree | 0c8ba96d8e55d78ab29f0f58b3dbcb3ba0b57c6b /tccelf.c | |
| parent | 557c5c1f11d592b68573bea4acebddc183292cfc (diff) | |
| download | tinycc-e22249b81c367afc43bbc8029e700964c21900ce.tar.gz tinycc-e22249b81c367afc43bbc8029e700964c21900ce.tar.bz2 | |
Error on unrecognized relocations
Diffstat (limited to 'tccelf.c')
| -rw-r--r-- | tccelf.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -1042,6 +1042,10 @@ ST_FUNC void build_got_entries(TCCState *s1) type = ELFW(R_TYPE)(rel->r_info); sym_index = ELFW(R_SYM)(rel->r_info); sym = &((ElfW(Sym) *)symtab_section->data)[sym_index]; + + if (type >= R_NUM || !relocs_info[type].known) + tcc_error("Unknown relocation: %d\n", type); + if (relocs_info[type].gotplt_entry == NO_GOTPLT_ENTRY) continue; |
