OLD | NEW |
1 /* BFD back-end for National Semiconductor's CRX ELF | 1 /* BFD back-end for National Semiconductor's CRX ELF |
2 Copyright 2004, 2005, 2006, 2007, 2009, 2010 | 2 Copyright 2004, 2005, 2006, 2007, 2009, 2010, 2012 |
3 Free Software Foundation, Inc. | 3 Free Software Foundation, Inc. |
4 Written by Tomer Levi, NSC, Israel. | 4 Written by Tomer Levi, NSC, Israel. |
5 | 5 |
6 This file is part of BFD, the Binary File Descriptor library. | 6 This file is part of BFD, the Binary File Descriptor library. |
7 | 7 |
8 This program is free software; you can redistribute it and/or modify | 8 This program is free software; you can redistribute it and/or modify |
9 it under the terms of the GNU General Public License as published by | 9 it under the terms of the GNU General Public License as published by |
10 the Free Software Foundation; either version 3 of the License, or | 10 the Free Software Foundation; either version 3 of the License, or |
11 (at your option) any later version. | 11 (at your option) any later version. |
12 | 12 |
(...skipping 734 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
747 | 747 |
748 if ((input_section->flags & SEC_RELOC) != 0 | 748 if ((input_section->flags & SEC_RELOC) != 0 |
749 && input_section->reloc_count > 0) | 749 && input_section->reloc_count > 0) |
750 { | 750 { |
751 Elf_Internal_Sym *isym; | 751 Elf_Internal_Sym *isym; |
752 Elf_Internal_Sym *isymend; | 752 Elf_Internal_Sym *isymend; |
753 asection **secpp; | 753 asection **secpp; |
754 bfd_size_type amt; | 754 bfd_size_type amt; |
755 | 755 |
756 internal_relocs = (_bfd_elf_link_read_relocs | 756 internal_relocs = (_bfd_elf_link_read_relocs |
757 » » » (input_bfd, input_section, (PTR) NULL, | 757 » » » (input_bfd, input_section, NULL, |
758 (Elf_Internal_Rela *) NULL, FALSE)); | 758 (Elf_Internal_Rela *) NULL, FALSE)); |
759 if (internal_relocs == NULL) | 759 if (internal_relocs == NULL) |
760 goto error_return; | 760 goto error_return; |
761 | 761 |
762 if (symtab_hdr->sh_info != 0) | 762 if (symtab_hdr->sh_info != 0) |
763 { | 763 { |
764 isymbuf = (Elf_Internal_Sym *) symtab_hdr->contents; | 764 isymbuf = (Elf_Internal_Sym *) symtab_hdr->contents; |
765 if (isymbuf == NULL) | 765 if (isymbuf == NULL) |
766 isymbuf = bfd_elf_get_elf_syms (input_bfd, symtab_hdr, | 766 isymbuf = bfd_elf_get_elf_syms (input_bfd, symtab_hdr, |
767 symtab_hdr->sh_info, 0, | 767 symtab_hdr->sh_info, 0, |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
866 else | 866 else |
867 { | 867 { |
868 bfd_boolean unresolved_reloc, warned; | 868 bfd_boolean unresolved_reloc, warned; |
869 | 869 |
870 RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel, | 870 RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel, |
871 r_symndx, symtab_hdr, sym_hashes, | 871 r_symndx, symtab_hdr, sym_hashes, |
872 h, sec, relocation, | 872 h, sec, relocation, |
873 unresolved_reloc, warned); | 873 unresolved_reloc, warned); |
874 } | 874 } |
875 | 875 |
876 if (sec != NULL && elf_discarded_section (sec)) | 876 if (sec != NULL && discarded_section (sec)) |
877 RELOC_AGAINST_DISCARDED_SECTION (info, input_bfd, input_section, | 877 RELOC_AGAINST_DISCARDED_SECTION (info, input_bfd, input_section, |
878 » » » » » rel, relend, howto, contents); | 878 » » » » » rel, 1, relend, howto, 0, contents); |
879 | 879 |
880 if (info->relocatable) | 880 if (info->relocatable) |
881 continue; | 881 continue; |
882 | 882 |
883 r = crx_elf_final_link_relocate (howto, input_bfd, output_bfd, | 883 r = crx_elf_final_link_relocate (howto, input_bfd, output_bfd, |
884 input_section, | 884 input_section, |
885 contents, rel->r_offset, | 885 contents, rel->r_offset, |
886 relocation, rel->r_addend, | 886 relocation, rel->r_addend, |
887 info, sec, h == NULL); | 887 info, sec, h == NULL); |
888 | 888 |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
977 if (link_info->relocatable | 977 if (link_info->relocatable |
978 || (sec->flags & SEC_RELOC) == 0 | 978 || (sec->flags & SEC_RELOC) == 0 |
979 || sec->reloc_count == 0 | 979 || sec->reloc_count == 0 |
980 || (sec->flags & SEC_CODE) == 0) | 980 || (sec->flags & SEC_CODE) == 0) |
981 return TRUE; | 981 return TRUE; |
982 | 982 |
983 symtab_hdr = &elf_tdata (abfd)->symtab_hdr; | 983 symtab_hdr = &elf_tdata (abfd)->symtab_hdr; |
984 | 984 |
985 /* Get a copy of the native relocations. */ | 985 /* Get a copy of the native relocations. */ |
986 internal_relocs = (_bfd_elf_link_read_relocs | 986 internal_relocs = (_bfd_elf_link_read_relocs |
987 » » (abfd, sec, (PTR) NULL, (Elf_Internal_Rela *) NULL, | 987 » » (abfd, sec, NULL, (Elf_Internal_Rela *) NULL, |
988 link_info->keep_memory)); | 988 link_info->keep_memory)); |
989 if (internal_relocs == NULL) | 989 if (internal_relocs == NULL) |
990 goto error_return; | 990 goto error_return; |
991 | 991 |
992 /* Walk through them looking for relaxing opportunities. */ | 992 /* Walk through them looking for relaxing opportunities. */ |
993 irelend = internal_relocs + sec->reloc_count; | 993 irelend = internal_relocs + sec->reloc_count; |
994 for (irel = internal_relocs; irel < irelend; irel++) | 994 for (irel = internal_relocs; irel < irelend; irel++) |
995 { | 995 { |
996 bfd_vma symval; | 996 bfd_vma symval; |
997 | 997 |
(...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1322 #define elf_info_to_howto elf_crx_info_to_howto | 1322 #define elf_info_to_howto elf_crx_info_to_howto |
1323 #define elf_info_to_howto_rel 0 | 1323 #define elf_info_to_howto_rel 0 |
1324 #define elf_backend_relocate_section elf32_crx_relocate_section | 1324 #define elf_backend_relocate_section elf32_crx_relocate_section |
1325 #define bfd_elf32_bfd_relax_section elf32_crx_relax_section | 1325 #define bfd_elf32_bfd_relax_section elf32_crx_relax_section |
1326 #define bfd_elf32_bfd_get_relocated_section_contents \ | 1326 #define bfd_elf32_bfd_get_relocated_section_contents \ |
1327 elf32_crx_get_relocated_section_contents | 1327 elf32_crx_get_relocated_section_contents |
1328 #define elf_backend_can_gc_sections 1 | 1328 #define elf_backend_can_gc_sections 1 |
1329 #define elf_backend_rela_normal 1 | 1329 #define elf_backend_rela_normal 1 |
1330 | 1330 |
1331 #include "elf32-target.h" | 1331 #include "elf32-target.h" |
OLD | NEW |