Ticket #37520: patch_as_ppc.diff
File patch_as_ppc.diff, 1.6 KB (added by internetzel, 12 years ago) |
---|
-
as/ppc.c
old new 2 2 #include <string.h> 3 3 #include <stdlib.h> 4 4 #include <mach-o/ppc/reloc.h> 5 #include "stuff/macosx_deployment_target.h" 5 6 #include "ppc-opcode.h" 6 7 #include "as.h" 7 8 #include "flonum.h" … … 17 18 #include "sections.h" 18 19 #include "dwarf2dbg.h" 19 20 21 /* The Mac OS X deployment target */ 22 __private_extern__ struct macosx_deployment_target 23 macosx_deployment_target = { 0 }; 24 20 25 /* 21 26 * The assembler can assemble the trailing +/- by setting either the Y-bit or 22 27 * the AT-bits. The default is setting the Y-bit and is the same as specifying: … … 490 495 add_to_macro_definition(ppc_macros[i].body); 491 496 s_endmacro(0); 492 497 } 498 499 /* 500 * Pick up the Mac OS X deployment target. 501 */ 502 get_macosx_deployment_target(&macosx_deployment_target); 493 503 } 494 504 495 505 /* … … 1286 1296 param += 5; 1287 1297 } 1288 1298 else if(strncmp(param,"lo16(",5) == 0){ 1289 if(format->ops[parcnt].type == DS) 1299 if((format->ops[parcnt].type == DS) 1300 && (macosx_deployment_target.major < 4)) // PPC_RELOC_LO14 not supported and not needed by dyld on 10.4 and later 1290 1301 insn->reloc = PPC_RELOC_LO14; 1291 1302 else 1292 1303 insn->reloc = PPC_RELOC_LO16; … … 1371 1382 param += 5; 1372 1383 } 1373 1384 else if(strncmp(param,"lo16(",5) == 0){ 1374 if(format->ops[parcnt].type == DS) 1385 if((format->ops[parcnt].type == DS) 1386 && (macosx_deployment_target.major < 4)) // PPC_RELOC_LO14 not supported and not needed by dyld on 10.4 and later 1375 1387 insn->reloc = PPC_RELOC_LO14; 1376 1388 else 1377 1389 insn->reloc = PPC_RELOC_LO16;