aboutsummaryrefslogtreecommitdiff
path: root/tccelf.c
diff options
context:
space:
mode:
authorFrederic Feret <tommy.planet@free.fr>2009-08-27 09:34:35 +0200
committergrischka <grischka>2009-11-13 18:08:58 +0100
commit0d768b97130ef2180725c4e585bb482ed0dea105 (patch)
tree11f169d0ad1af72cbcb4db5675c6cc47736af133 /tccelf.c
parent2349efa61b5ced91eb078aaa036e5bc37816fd47 (diff)
downloadtinycc-0d768b97130ef2180725c4e585bb482ed0dea105.tar.gz
tinycc-0d768b97130ef2180725c4e585bb482ed0dea105.tar.bz2
added 16-bit x86 assembly support
Diffstat (limited to 'tccelf.c')
-rw-r--r--tccelf.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/tccelf.c b/tccelf.c
index e87f2be..34a4df9 100644
--- a/tccelf.c
+++ b/tccelf.c
@@ -591,6 +591,18 @@ static void relocate_section(TCCState *s1, Section *s)
/* we load the got offset */
*(int *)ptr += s1->got_offsets[sym_index];
break;
+ case R_386_16:
+ if (s1->output_format != TCC_OUTPUT_FORMAT_BINARY) {
+ output_file:
+ error("can only produce 16-bit binary files");
+ }
+ *(short *)ptr += val;
+ break;
+ case R_386_PC16:
+ if (s1->output_format != TCC_OUTPUT_FORMAT_BINARY)
+ goto output_file;
+ *(short *)ptr += val - addr;
+ break;
#elif defined(TCC_TARGET_ARM)
case R_ARM_PC24:
case R_ARM_CALL: