tc-alpha.c (104834) | tc-alpha.c (107492) |
---|---|
1/* tc-alpha.c - Processor-specific code for the DEC Alpha AXP CPU. 2 Copyright 1989, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 3 2001, 2002 Free Software Foundation, Inc. 4 Contributed by Carnegie Mellon University, 1993. 5 Written by Alessandro Forin, based on earlier gas-1.38 target CPU files. 6 Modified by Ken Raeburn for gas-2.x and ECOFF support. 7 Modified by Richard Henderson for ELF support. 8 Modified by Klaus K"ampf for EVAX (OpenVMS/Alpha) support. --- 1398 unchanged lines hidden (view full) --- 1407 1408void 1409alpha_define_label (sym) 1410 symbolS *sym; 1411{ 1412 alpha_insn_label = sym; 1413} 1414 | 1/* tc-alpha.c - Processor-specific code for the DEC Alpha AXP CPU. 2 Copyright 1989, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 3 2001, 2002 Free Software Foundation, Inc. 4 Contributed by Carnegie Mellon University, 1993. 5 Written by Alessandro Forin, based on earlier gas-1.38 target CPU files. 6 Modified by Ken Raeburn for gas-2.x and ECOFF support. 7 Modified by Richard Henderson for ELF support. 8 Modified by Klaus K"ampf for EVAX (OpenVMS/Alpha) support. --- 1398 unchanged lines hidden (view full) --- 1407 1408void 1409alpha_define_label (sym) 1410 symbolS *sym; 1411{ 1412 alpha_insn_label = sym; 1413} 1414 |
1415/* If we have a BRSGP reloc to a local symbol, adjust it to BRADDR and 1416 let it get resolved at assembly time. */ 1417 1418void 1419alpha_validate_fix (f) 1420 fixS *f; 1421{ 1422#ifdef OBJ_ELF 1423 int offset = 0; 1424 const char *name; 1425 1426 if (f->fx_r_type != BFD_RELOC_ALPHA_BRSGP) 1427 return; 1428 1429 if (! S_IS_DEFINED (f->fx_addsy)) 1430 return; 1431 1432 switch (S_GET_OTHER (f->fx_addsy) & STO_ALPHA_STD_GPLOAD) 1433 { 1434 case STO_ALPHA_NOPV: 1435 break; 1436 case STO_ALPHA_STD_GPLOAD: 1437 offset = 8; 1438 break; 1439 default: 1440 if (S_IS_LOCAL (f->fx_addsy)) 1441 name = "<local>"; 1442 else 1443 name = S_GET_NAME (f->fx_addsy); 1444 as_bad_where (f->fx_file, f->fx_line, 1445 _("!samegp reloc against symbol without .prologue: %s"), 1446 name); 1447 break; 1448 } 1449 1450 if (! (S_IS_EXTERN (f->fx_addsy) || S_IS_WEAK (f->fx_addsy))) 1451 { 1452 f->fx_r_type = BFD_RELOC_23_PCREL_S2; 1453 f->fx_offset += offset; 1454 } 1455#endif 1456} 1457 | |
1458/* Return true if we must always emit a reloc for a type and false if 1459 there is some hope of resolving it at assembly time. */ 1460 1461int 1462alpha_force_relocation (f) 1463 fixS *f; 1464{ 1465 if (alpha_flag_relax) --- 53 unchanged lines hidden (view full) --- 1519 1520 /* Are there any relocation types for which we must generate a reloc 1521 but we can adjust the values contained within it? */ 1522 switch (f->fx_r_type) 1523 { 1524 case BFD_RELOC_ALPHA_GPDISP_HI16: 1525 case BFD_RELOC_ALPHA_GPDISP_LO16: 1526 case BFD_RELOC_ALPHA_GPDISP: | 1415/* Return true if we must always emit a reloc for a type and false if 1416 there is some hope of resolving it at assembly time. */ 1417 1418int 1419alpha_force_relocation (f) 1420 fixS *f; 1421{ 1422 if (alpha_flag_relax) --- 53 unchanged lines hidden (view full) --- 1476 1477 /* Are there any relocation types for which we must generate a reloc 1478 but we can adjust the values contained within it? */ 1479 switch (f->fx_r_type) 1480 { 1481 case BFD_RELOC_ALPHA_GPDISP_HI16: 1482 case BFD_RELOC_ALPHA_GPDISP_LO16: 1483 case BFD_RELOC_ALPHA_GPDISP: |
1527 case BFD_RELOC_ALPHA_BRSGP: | |
1528 return 0; 1529 1530 case BFD_RELOC_ALPHA_LITERAL: 1531 case BFD_RELOC_ALPHA_ELF_LITERAL: 1532 case BFD_RELOC_ALPHA_LITUSE: 1533 case BFD_RELOC_ALPHA_LINKAGE: 1534 case BFD_RELOC_ALPHA_CODEADDR: 1535 return 1; --- 21 unchanged lines hidden (view full) --- 1557 case BFD_RELOC_ALPHA_GOTTPREL16: 1558 case BFD_RELOC_ALPHA_TPREL_HI16: 1559 case BFD_RELOC_ALPHA_TPREL_LO16: 1560 case BFD_RELOC_ALPHA_TPREL16: 1561 /* ??? No idea why we can't return a reference to .tbss+10, but 1562 we're preventing this in the other assemblers. Follow for now. */ 1563 return 0; 1564 | 1484 return 0; 1485 1486 case BFD_RELOC_ALPHA_LITERAL: 1487 case BFD_RELOC_ALPHA_ELF_LITERAL: 1488 case BFD_RELOC_ALPHA_LITUSE: 1489 case BFD_RELOC_ALPHA_LINKAGE: 1490 case BFD_RELOC_ALPHA_CODEADDR: 1491 return 1; --- 21 unchanged lines hidden (view full) --- 1513 case BFD_RELOC_ALPHA_GOTTPREL16: 1514 case BFD_RELOC_ALPHA_TPREL_HI16: 1515 case BFD_RELOC_ALPHA_TPREL_LO16: 1516 case BFD_RELOC_ALPHA_TPREL16: 1517 /* ??? No idea why we can't return a reference to .tbss+10, but 1518 we're preventing this in the other assemblers. Follow for now. */ 1519 return 0; 1520 |
1521 case BFD_RELOC_ALPHA_BRSGP: 1522 /* If we have a BRSGP reloc to a local symbol, adjust it to BRADDR and 1523 let it get resolved at assembly time. */ 1524 { 1525 symbolS *sym = f->fx_addsy; 1526 const char *name; 1527 int offset = 0; 1528 1529 if (! S_IS_DEFINED (sym)) 1530 return 0; 1531 1532 switch (S_GET_OTHER (sym) & STO_ALPHA_STD_GPLOAD) 1533 { 1534 case STO_ALPHA_NOPV: 1535 break; 1536 case STO_ALPHA_STD_GPLOAD: 1537 offset = 8; 1538 break; 1539 default: 1540 if (S_IS_LOCAL (sym)) 1541 name = "<local>"; 1542 else 1543 name = S_GET_NAME (sym); 1544 as_bad_where (f->fx_file, f->fx_line, 1545 _("!samegp reloc against symbol without .prologue: %s"), 1546 name); 1547 break; 1548 } 1549 f->fx_r_type = BFD_RELOC_23_PCREL_S2; 1550 f->fx_offset += offset; 1551 return 1; 1552 } 1553 |
|
1565 default: 1566 return 1; 1567 } 1568 /*NOTREACHED*/ 1569} 1570 1571/* Generate the BFD reloc to be stuck in the object file from the 1572 fixup used internally in the assembler. */ --- 2959 unchanged lines hidden (view full) --- 4532 4533 arg = get_absolute_expression (); 4534 demand_empty_rest_of_line (); 4535 4536 if (ECOFF_DEBUGGING) 4537 sym = ecoff_get_cur_proc_sym (); 4538 else 4539 sym = alpha_cur_ent_sym; | 1554 default: 1555 return 1; 1556 } 1557 /*NOTREACHED*/ 1558} 1559 1560/* Generate the BFD reloc to be stuck in the object file from the 1561 fixup used internally in the assembler. */ --- 2959 unchanged lines hidden (view full) --- 4521 4522 arg = get_absolute_expression (); 4523 demand_empty_rest_of_line (); 4524 4525 if (ECOFF_DEBUGGING) 4526 sym = ecoff_get_cur_proc_sym (); 4527 else 4528 sym = alpha_cur_ent_sym; |
4540 know (sym != NULL); | |
4541 | 4529 |
4530 if (sym == NULL) 4531 { 4532 as_bad (_(".prologue directive without a preceding .ent directive")); 4533 return; 4534 } 4535 |
|
4542 switch (arg) 4543 { 4544 case 0: /* No PV required. */ 4545 S_SET_OTHER (sym, STO_ALPHA_NOPV 4546 | (S_GET_OTHER (sym) & ~STO_ALPHA_STD_GPLOAD)); 4547 break; 4548 case 1: /* Std GP load. */ 4549 S_SET_OTHER (sym, STO_ALPHA_STD_GPLOAD --- 939 unchanged lines hidden (view full) --- 5489#ifdef OBJ_ELF 5490 /* Frame related pseudos. */ 5491 {"ent", s_alpha_ent, 0}, 5492 {"end", s_alpha_end, 0}, 5493 {"mask", s_alpha_mask, 0}, 5494 {"fmask", s_alpha_mask, 1}, 5495 {"frame", s_alpha_frame, 0}, 5496 {"prologue", s_alpha_prologue, 0}, | 4536 switch (arg) 4537 { 4538 case 0: /* No PV required. */ 4539 S_SET_OTHER (sym, STO_ALPHA_NOPV 4540 | (S_GET_OTHER (sym) & ~STO_ALPHA_STD_GPLOAD)); 4541 break; 4542 case 1: /* Std GP load. */ 4543 S_SET_OTHER (sym, STO_ALPHA_STD_GPLOAD --- 939 unchanged lines hidden (view full) --- 5483#ifdef OBJ_ELF 5484 /* Frame related pseudos. */ 5485 {"ent", s_alpha_ent, 0}, 5486 {"end", s_alpha_end, 0}, 5487 {"mask", s_alpha_mask, 0}, 5488 {"fmask", s_alpha_mask, 1}, 5489 {"frame", s_alpha_frame, 0}, 5490 {"prologue", s_alpha_prologue, 0}, |
5497 {"file", s_alpha_file, 5}, | 5491 {"file", (void (*) PARAMS ((int))) s_alpha_file, 5}, |
5498 {"loc", s_alpha_loc, 9}, 5499 {"stabs", s_alpha_stab, 's'}, 5500 {"stabn", s_alpha_stab, 'n'}, 5501 /* COFF debugging related pseudos. */ 5502 {"begin", s_alpha_coff_wrapper, 0}, 5503 {"bend", s_alpha_coff_wrapper, 1}, 5504 {"def", s_alpha_coff_wrapper, 2}, 5505 {"dim", s_alpha_coff_wrapper, 3}, --- 245 unchanged lines hidden --- | 5492 {"loc", s_alpha_loc, 9}, 5493 {"stabs", s_alpha_stab, 's'}, 5494 {"stabn", s_alpha_stab, 'n'}, 5495 /* COFF debugging related pseudos. */ 5496 {"begin", s_alpha_coff_wrapper, 0}, 5497 {"bend", s_alpha_coff_wrapper, 1}, 5498 {"def", s_alpha_coff_wrapper, 2}, 5499 {"dim", s_alpha_coff_wrapper, 3}, --- 245 unchanged lines hidden --- |