Backtrack sur les branchements absolus. Produire du code PIC pour IRIX

est plus complique que ca (passer l'adresse de la fonction appelee
dans $25?)


git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@237 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
master
Xavier Leroy 1995-08-30 15:36:59 +00:00
parent 14dad5b536
commit bf26cf7612
1 changed files with 3 additions and 26 deletions

View File

@ -156,27 +156,6 @@ let emit_frame fd =
fd.fd_live_offset;
` .align 2\n`
(* Output an absolute jump to a symbol.
Some OSes that produce position-independent code don't like "j symb". *)
let supports_absolute_jumps =
match Config.system with
"irix" -> false
| _ -> true
let emit_jump_symbol symb =
if supports_absolute_jumps then
` j {emit_symbol symb}\n`
else begin
` .set noreorder\n`;
` .set noat\n`;
` move $at, $31\n`;
` jal {emit_symbol symb}\n`;
` move $31, $at\n`;
` .set reorder\n`;
` .set at\n`
end
(* Names of various instructions *)
let name_for_comparison = function
@ -279,7 +258,7 @@ let emit_instr i =
if n > 0 then
` addu $sp, $sp, {emit_int n}\n`;
liveregs i 0;
emit_jump_symbol s
` j {emit_symbol s}\n`
end
| Lop(Iextcall(s, alloc)) ->
if alloc then begin
@ -481,10 +460,8 @@ let fundecl fundecl =
` sw $31, {emit_int(n - 4)}($sp)\n`;
`{emit_label !tailrec_entry_point}:\n`;
emit_all fundecl.fun_body;
if !call_gc_label > 0 then begin
`{emit_label !call_gc_label}: `;
emit_jump_symbol "caml_call_gc"
end;
if !call_gc_label > 0 then
`{emit_label !call_gc_label}: j caml_call_gc\n`;
if !range_check_trap > 0 then
`{emit_label !range_check_trap}: break BRK_RANGE\n`;
` .end {emit_symbol fundecl.fun_name}\n`