diff options
| author | Thomas Preud'homme <robotux@celest.fr> | 2012-11-09 10:59:06 +0100 |
|---|---|---|
| committer | Thomas Preud'homme <robotux@celest.fr> | 2012-11-09 10:59:06 +0100 |
| commit | 14c99236da35f393e25d08868126284b687008f7 (patch) | |
| tree | 01170538eb320d35544264ea0e2d9de230c2f067 /tccelf.c | |
| parent | 061b5799cc1feb15014da589ea98057deda14a23 (diff) | |
| download | tinycc-14c99236da35f393e25d08868126284b687008f7.tar.gz tinycc-14c99236da35f393e25d08868126284b687008f7.tar.bz2 | |
Call to veneers in ARM mode
Since commit c6630ef92a21ca33af08b1faa03fba578e12315f, Call to a veneer
when the final symbol to be reached is thumb is made through a blx
instruction. This is a mistake since veneers are ARM instructions and
should thus be called with a simple bl. This commit prevent the bl ->
blx conversion when a veneer is used.
Diffstat (limited to 'tccelf.c')
| -rw-r--r-- | tccelf.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -615,8 +615,10 @@ ST_FUNC void relocate_section(TCCState *s1, Section *s) #ifndef TCC_TARGET_PE if ((x & 3) || x >= 0x4000000 || x < -0x4000000) if (!(x & 3) || !blx_avail || !is_call) - if (s1->output_type == TCC_OUTPUT_MEMORY) + if (s1->output_type == TCC_OUTPUT_MEMORY) { x += add_jmp_table(s1, val) - val; /* add veneer */ + is_thumb = 0; /* Veneer uses ARM instructions */ + } #endif if ((x & 3) || x >= 0x4000000 || x < -0x4000000) if (!(x & 3) || !blx_avail || !is_call) |
