Changeset 1973 for binutils/trunk/bfd/elf32-cr16.c
- Timestamp:
- Feb 6, 2017, 1:00:00 PM (8 years ago)
- Location:
- binutils/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
binutils/trunk ¶
-
Property svn:mergeinfo
set to
/binutils/vendor/current merged eligible
-
Property svn:mergeinfo
set to
-
TabularUnified binutils/trunk/bfd/elf32-cr16.c ¶
r970 r1973 1 1 /* BFD back-end for National Semiconductor's CR16 ELF 2 Copyright (C) 2007-201 4Free Software Foundation, Inc.2 Copyright (C) 2007-2016 Free Software Foundation, Inc. 3 3 Written by M R Swami Reddy. 4 4 … … 116 116 HOWTO (R_CR16_NONE, /* type */ 117 117 0, /* rightshift */ 118 2, /* size */119 32,/* bitsize */118 3, /* size */ 119 0, /* bitsize */ 120 120 FALSE, /* pc_relative */ 121 121 0, /* bitpos */ … … 674 674 unsigned int r_type = ELF32_R_TYPE (dst->r_info); 675 675 676 BFD_ASSERT (r_type < (unsigned int) R_CR16_MAX); 676 if (r_type >= R_CR16_MAX) 677 { 678 (*_bfd_error_handler) (_("%B: unrecognised CR16 reloc number: %d"), 679 abfd, r_type); 680 bfd_set_error (bfd_error_bad_value); 681 r_type = R_CR16_NONE; 682 } 677 683 cache_ptr->howto = cr16_elf_howto_table + r_type; 678 684 } … … 700 706 bfd_boolean result = FALSE; 701 707 702 if ( info->relocatable)708 if (bfd_link_relocatable (info)) 703 709 return TRUE; 704 710 … … 762 768 763 769 if (srelgot == NULL 764 && (h != NULL || info->executable))770 && (h != NULL || bfd_link_executable (info))) 765 771 { 766 772 srelgot = bfd_get_linker_section (dynobj, ".rela.got"); … … 823 829 local_got_offsets[r_symndx] = sgot->size; 824 830 825 if ( info->executable)831 if (bfd_link_executable (info)) 826 832 /* If we are generating a shared object, we need to 827 833 output a R_CR16_RELATIVE reloc so that the dynamic … … 1438 1444 rel, 1, relend, howto, 0, contents); 1439 1445 1440 if ( info->relocatable)1446 if (bfd_link_relocatable (info)) 1441 1447 continue; 1442 1448 … … 1467 1473 { 1468 1474 case bfd_reloc_overflow: 1469 if (!((*info->callbacks->reloc_overflow) 1470 (info, (h ? &h->root : NULL), name, howto->name, 1471 (bfd_vma) 0, input_bfd, input_section, 1472 rel->r_offset))) 1473 return FALSE; 1475 (*info->callbacks->reloc_overflow) 1476 (info, (h ? &h->root : NULL), name, howto->name, 1477 (bfd_vma) 0, input_bfd, input_section, rel->r_offset); 1474 1478 break; 1475 1479 1476 1480 case bfd_reloc_undefined: 1477 if (!((*info->callbacks->undefined_symbol) 1478 (info, name, input_bfd, input_section, 1479 rel->r_offset, TRUE))) 1480 return FALSE; 1481 (*info->callbacks->undefined_symbol) 1482 (info, name, input_bfd, input_section, rel->r_offset, TRUE); 1481 1483 break; 1482 1484 … … 1498 1500 1499 1501 common_error: 1500 if (!((*info->callbacks->warning) 1501 (info, msg, name, input_bfd, input_section, 1502 rel->r_offset))) 1503 return FALSE; 1502 (*info->callbacks->warning) (info, msg, name, input_bfd, 1503 input_section, rel->r_offset); 1504 1504 break; 1505 1505 } … … 1771 1771 this section does not have relocs, or if this is not a 1772 1772 code section. */ 1773 if ( link_info->relocatable1773 if (bfd_link_relocatable (link_info) 1774 1774 || (sec->flags & SEC_RELOC) == 0 1775 1775 || sec->reloc_count == 0 … … 2304 2304 section when generating a shared object, since they do not use 2305 2305 copy relocs. */ 2306 if (! info->executable)2306 if (! bfd_link_executable (info)) 2307 2307 { 2308 2308 s = bfd_make_section_anyway_with_flags (abfd, … … 2349 2349 || h->needs_plt) 2350 2350 { 2351 if (! info->executable2351 if (! bfd_link_executable (info) 2352 2352 && !h->def_dynamic 2353 2353 && !h->ref_dynamic) … … 2404 2404 For such cases we need not do anything here; the relocations will 2405 2405 be handled correctly by relocate_section. */ 2406 if ( info->executable)2406 if (bfd_link_executable (info)) 2407 2407 return TRUE; 2408 2408 … … 2439 2439 } 2440 2440 2441 return _bfd_elf_adjust_dynamic_copy ( h, s);2441 return _bfd_elf_adjust_dynamic_copy (info, h, s); 2442 2442 } 2443 2443 … … 2460 2460 { 2461 2461 /* Set the contents of the .interp section to the interpreter. */ 2462 if ( info->executable)2462 if (bfd_link_executable (info) && !info->nointerp) 2463 2463 { 2464 2464 #if 0 … … 2577 2577 size for the .dynamic section. The DT_DEBUG entry is filled 2578 2578 in by the dynamic linker and used by the debugger. */ 2579 if (! info->executable)2579 if (! bfd_link_executable (info)) 2580 2580 { 2581 2581 if (!_bfd_elf_add_dynamic_entry (info, DT_DEBUG, 0)) … … 2645 2645 The entry in the global offset table will already have been 2646 2646 initialized in the relocate_section function. */ 2647 if ( info->executable2647 if (bfd_link_executable (info) 2648 2648 && (info->symbolic || h->dynindx == -1) 2649 2649 && h->def_regular) … … 2739 2739 2740 2740 case DT_PLTGOT: 2741 name = ".got ";2741 name = ".got.plt"; 2742 2742 goto get_vma; 2743 2743 … … 2745 2745 name = ".rela.plt"; 2746 2746 get_vma: 2747 s = bfd_get_section_by_name (output_bfd, name); 2748 BFD_ASSERT (s != NULL); 2749 dyn.d_un.d_ptr = s->vma; 2747 s = bfd_get_linker_section (dynobj, name); 2748 dyn.d_un.d_ptr = s->output_section->vma + s->output_offset; 2750 2749 bfd_elf32_swap_dyn_out (output_bfd, &dyn, dyncon); 2751 2750 break; 2752 2751 2753 2752 case DT_PLTRELSZ: 2754 s = bfd_get_section_by_name (output_bfd, ".rela.plt"); 2755 BFD_ASSERT (s != NULL); 2753 s = bfd_get_linker_section (dynobj, ".rela.plt"); 2756 2754 dyn.d_un.d_val = s->size; 2757 2755 bfd_elf32_swap_dyn_out (output_bfd, &dyn, dyncon); … … 2768 2766 other relocation sections, we don't have to worry 2769 2767 about changing the DT_RELA entry. */ 2770 s = bfd_get_ section_by_name (output_bfd, ".rela.plt");2768 s = bfd_get_linker_section (dynobj, ".rela.plt"); 2771 2769 if (s != NULL) 2772 2770 dyn.d_un.d_val -= s->size; … … 2815 2813 bfd_size_type amt; 2816 2814 2817 BFD_ASSERT (! info->relocatable);2815 BFD_ASSERT (! bfd_link_relocatable (info)); 2818 2816 2819 2817 *errmsg = NULL;
Note:
See TracChangeset
for help on using the changeset viewer.