📄 700-nios2-2.15.patch
字号:
+ BFD_RELOC_NIOS2_IMM8,+ BFD_RELOC_NIOS2_HI16,+ BFD_RELOC_NIOS2_LO16,+ BFD_RELOC_NIOS2_HIADJ16,+ BFD_RELOC_NIOS2_GPREL,+ BFD_RELOC_NIOS2_UJMP,+ BFD_RELOC_NIOS2_CJMP,+ BFD_RELOC_NIOS2_CALLR,+ BFD_RELOC_NIOS2_ALIGN,+ /* IQ2000 Relocations. */ BFD_RELOC_IQ2000_OFFSET_16, BFD_RELOC_IQ2000_OFFSET_21,@@ -3477,10 +3526,11 @@ BFD_RELOC_XTENSA_ASM_EXPAND. */ BFD_RELOC_XTENSA_ASM_SIMPLIFY, BFD_RELOC_UNUSED }; typedef enum bfd_reloc_code_real bfd_reloc_code_real_type;-reloc_howto_type *bfd_reloc_type_lookup- (bfd *abfd, bfd_reloc_code_real_type code);+reloc_howto_type *+bfd_reloc_type_lookup PARAMS ((bfd *abfd, bfd_reloc_code_real_type code)); -const char *bfd_get_reloc_code_name (bfd_reloc_code_real_type code);+const char *+bfd_get_reloc_code_name PARAMS ((bfd_reloc_code_real_type code)); /* Extracted from syms.c. */ @@ -3611,9 +3661,11 @@ asymbol; #define bfd_get_symtab_upper_bound(abfd) \ BFD_SEND (abfd, _bfd_get_symtab_upper_bound, (abfd)) -bfd_boolean bfd_is_local_label (bfd *abfd, asymbol *sym);+bfd_boolean+bfd_is_local_label PARAMS ((bfd *abfd, asymbol *sym)); -bfd_boolean bfd_is_local_label_name (bfd *abfd, const char *name);+bfd_boolean+bfd_is_local_label_name PARAMS ((bfd *abfd, const char *name)); #define bfd_is_local_label_name(abfd, name) \ BFD_SEND (abfd, _bfd_is_local_label_name, (abfd, name))@@ -3621,27 +3673,32 @@ bfd_boolean bfd_is_local_label_name (bfd #define bfd_canonicalize_symtab(abfd, location) \ BFD_SEND (abfd, _bfd_canonicalize_symtab, (abfd, location)) -bfd_boolean bfd_set_symtab- (bfd *abfd, asymbol **location, unsigned int count);+bfd_boolean+bfd_set_symtab PARAMS ((bfd *abfd, asymbol **location, unsigned int count)); -void bfd_print_symbol_vandf (bfd *abfd, void *file, asymbol *symbol);+void+bfd_print_symbol_vandf PARAMS ((bfd *abfd, void *file, asymbol *symbol)); #define bfd_make_empty_symbol(abfd) \ BFD_SEND (abfd, _bfd_make_empty_symbol, (abfd)) -asymbol *_bfd_generic_make_empty_symbol (bfd *);+asymbol *+_bfd_generic_make_empty_symbol PARAMS ((bfd *)); #define bfd_make_debug_symbol(abfd,ptr,size) \ BFD_SEND (abfd, _bfd_make_debug_symbol, (abfd, ptr, size)) -int bfd_decode_symclass (asymbol *symbol);+int+bfd_decode_symclass PARAMS ((asymbol *symbol)); -bfd_boolean bfd_is_undefined_symclass (int symclass);+bfd_boolean+bfd_is_undefined_symclass PARAMS ((int symclass)); -void bfd_symbol_info (asymbol *symbol, symbol_info *ret);+void+bfd_symbol_info PARAMS ((asymbol *symbol, symbol_info *ret)); -bfd_boolean bfd_copy_private_symbol_data- (bfd *ibfd, asymbol *isym, bfd *obfd, asymbol *osym);+bfd_boolean+bfd_copy_private_symbol_data PARAMS ((bfd *ibfd, asymbol *isym, bfd *obfd, asymbol *osym)); #define bfd_copy_private_symbol_data(ibfd, isymbol, obfd, osymbol) \ BFD_SEND (obfd, _bfd_copy_private_symbol_data, \@@ -3840,57 +3897,76 @@ typedef enum bfd_error } bfd_error_type; -bfd_error_type bfd_get_error (void);+bfd_error_type+bfd_get_error PARAMS ((void)); -void bfd_set_error (bfd_error_type error_tag);+void+bfd_set_error PARAMS ((bfd_error_type error_tag)); -const char *bfd_errmsg (bfd_error_type error_tag);+const char *+bfd_errmsg PARAMS ((bfd_error_type error_tag)); -void bfd_perror (const char *message);+void+bfd_perror PARAMS ((const char *message)); typedef void (*bfd_error_handler_type) (const char *, ...); -bfd_error_handler_type bfd_set_error_handler (bfd_error_handler_type);+bfd_error_handler_type+bfd_set_error_handler PARAMS ((bfd_error_handler_type)); -void bfd_set_error_program_name (const char *);+void+bfd_set_error_program_name PARAMS ((const char *)); -bfd_error_handler_type bfd_get_error_handler (void);+bfd_error_handler_type+bfd_get_error_handler PARAMS ((void)); -const char *bfd_archive_filename (bfd *);+const char *+bfd_archive_filename PARAMS ((bfd *)); -long bfd_get_reloc_upper_bound (bfd *abfd, asection *sect);+long+bfd_get_reloc_upper_bound PARAMS ((bfd *abfd, asection *sect)); -long bfd_canonicalize_reloc- (bfd *abfd, asection *sec, arelent **loc, asymbol **syms);+long+bfd_canonicalize_reloc PARAMS ((bfd *abfd, asection *sec, arelent **loc, asymbol **syms)); -void bfd_set_reloc- (bfd *abfd, asection *sec, arelent **rel, unsigned int count);+void+bfd_set_reloc PARAMS ((bfd *abfd, asection *sec, arelent **rel, unsigned int count)); -bfd_boolean bfd_set_file_flags (bfd *abfd, flagword flags);+bfd_boolean+bfd_set_file_flags PARAMS ((bfd *abfd, flagword flags)); -int bfd_get_arch_size (bfd *abfd);+int+bfd_get_arch_size PARAMS ((bfd *abfd)); -int bfd_get_sign_extend_vma (bfd *abfd);+int+bfd_get_sign_extend_vma PARAMS ((bfd *abfd)); -bfd_boolean bfd_set_start_address (bfd *abfd, bfd_vma vma);+bfd_boolean+bfd_set_start_address PARAMS ((bfd *abfd, bfd_vma vma)); -unsigned int bfd_get_gp_size (bfd *abfd);+unsigned int+bfd_get_gp_size PARAMS ((bfd *abfd)); -void bfd_set_gp_size (bfd *abfd, unsigned int i);+void+bfd_set_gp_size PARAMS ((bfd *abfd, unsigned int i)); -bfd_vma bfd_scan_vma (const char *string, const char **end, int base);+bfd_vma+bfd_scan_vma PARAMS ((const char *string, const char **end, int base)); -bfd_boolean bfd_copy_private_bfd_data (bfd *ibfd, bfd *obfd);+bfd_boolean+bfd_copy_private_bfd_data PARAMS ((bfd *ibfd, bfd *obfd)); #define bfd_copy_private_bfd_data(ibfd, obfd) \ BFD_SEND (obfd, _bfd_copy_private_bfd_data, \ (ibfd, obfd))-bfd_boolean bfd_merge_private_bfd_data (bfd *ibfd, bfd *obfd);+bfd_boolean+bfd_merge_private_bfd_data PARAMS ((bfd *ibfd, bfd *obfd)); #define bfd_merge_private_bfd_data(ibfd, obfd) \ BFD_SEND (obfd, _bfd_merge_private_bfd_data, \ (ibfd, obfd))-bfd_boolean bfd_set_private_flags (bfd *abfd, flagword flags);+bfd_boolean+bfd_set_private_flags PARAMS ((bfd *abfd, flagword flags)); #define bfd_set_private_flags(abfd, flags) \ BFD_SEND (abfd, _bfd_set_private_flags, (abfd, flags))@@ -3968,7 +4044,8 @@ extern bfd_byte *bfd_get_relocated_secti (bfd *, struct bfd_link_info *, struct bfd_link_order *, bfd_byte *, bfd_boolean, asymbol **); -bfd_boolean bfd_alt_mach_code (bfd *abfd, int alternative);+bfd_boolean+bfd_alt_mach_code PARAMS ((bfd *abfd, int alternative)); struct bfd_preserve {@@ -3982,27 +4059,34 @@ struct bfd_preserve struct bfd_hash_table section_htab; }; -bfd_boolean bfd_preserve_save (bfd *, struct bfd_preserve *);+bfd_boolean+bfd_preserve_save PARAMS ((bfd *, struct bfd_preserve *)); -void bfd_preserve_restore (bfd *, struct bfd_preserve *);+void+bfd_preserve_restore PARAMS ((bfd *, struct bfd_preserve *)); -void bfd_preserve_finish (bfd *, struct bfd_preserve *);+void+bfd_preserve_finish PARAMS ((bfd *, struct bfd_preserve *)); /* Extracted from archive.c. */-symindex bfd_get_next_mapent- (bfd *abfd, symindex previous, carsym **sym);+symindex+bfd_get_next_mapent PARAMS ((bfd *abfd, symindex previous, carsym **sym)); -bfd_boolean bfd_set_archive_head (bfd *output, bfd *new_head);+bfd_boolean+bfd_set_archive_head PARAMS ((bfd *output, bfd *new_head)); -bfd *bfd_openr_next_archived_file (bfd *archive, bfd *previous);+bfd *+bfd_openr_next_archived_file PARAMS ((bfd *archive, bfd *previous)); /* Extracted from corefile.c. */-const char *bfd_core_file_failing_command (bfd *abfd);+const char *+bfd_core_file_failing_command PARAMS ((bfd *abfd)); -int bfd_core_file_failing_signal (bfd *abfd);+int+bfd_core_file_failing_signal PARAMS ((bfd *abfd)); -bfd_boolean core_file_matches_executable_p- (bfd *core_bfd, bfd *exec_bfd);+bfd_boolean+core_file_matches_executable_p PARAMS ((bfd *core_bfd, bfd *exec_bfd)); /* Extracted from targets.c. */ #define BFD_SEND(bfd, message, arglist) \@@ -4362,35 +4446,42 @@ typedef struct bfd_target } bfd_target; -bfd_boolean bfd_set_default_target (const char *name);+bfd_boolean+bfd_set_default_target PARAMS ((const char *name)); -const bfd_target *bfd_find_target (const char *target_name, bfd *abfd);+const bfd_target *+bfd_find_target PARAMS ((const char *target_name, bfd *abfd)); -const char ** bfd_target_list (void);+const char **+bfd_target_list PARAMS ((void)); -const bfd_target *bfd_search_for_target- (int (*search_func) (const bfd_target *, void *),- void *);+const bfd_target *+bfd_search_for_target PARAMS ((int (*search_func) (const bfd_target *, void *),+ void *)); /* Extracted from format.c. */-bfd_boolean bfd_check_format (bfd *abfd, bfd_format format);+bfd_boolean+bfd_check_format PARAMS ((bfd *abfd, bfd_format format)); -bfd_boolean bfd_check_format_matches- (bfd *abfd, bfd_format format, char ***matching);+bfd_boolean+bfd_check_format_matches PARAMS ((bfd *abfd, bfd_format format, char ***matching)); -bfd_boolean bfd_set_format (bfd *abfd, bfd_format format);+bfd_boolean+bfd_set_format PARAMS ((bfd *abfd, bfd_format format)); -const char *bfd_format_string (bfd_format format);+const char *+bfd_format_string PARAMS ((bfd_format format)); /* Extracted from linker.c. */-bfd_boolean bfd_link_split_section (bfd *abfd, asection *sec);+bfd_boolean+bfd_link_split_section PARAMS ((bfd *abfd, asection *sec)); #define bfd_link_split_section(abfd, sec) \ BFD_SEND (abfd, _bfd_link_split_section, (abfd, sec)) /* Extracted from simple.c. */-bfd_byte *bfd_simple_get_relocated_section_contents- (bfd *abfd, asection *sec, bfd_byte *outbuf, asymbol **symbol_table);+bfd_byte *+bfd_simple_get_relocated_section_contents PARAMS ((bfd *abfd, asection *sec, bfd_byte *outbuf, asymbol **symbol_table)); #ifdef __cplusplus }--- binutils-2.15/bfd/config.bfd 2004-05-17 21:35:56.000000000 +0200+++ binutils-2.15-nios2/bfd/config.bfd 2005-05-17 12:20:13.000000000 +0200@@ -59,6 +59,7 @@ m6812*|m68hc12*) targ_archs="bfd_m68hc12 m68*) targ_archs=bfd_m68k_arch ;; m88*) targ_archs=bfd_m88k_arch ;; mips*) targ_archs=bfd_mips_arch ;;+nios2*) targ_archs=bfd_nios2_arch ;; or32*) targ_archs=bfd_or32_arch ;; pdp11*) targ_archs=bfd_pdp11_arch ;; pj*) targ_archs="bfd_pj_arch bfd_i386_arch";;@@ -874,6 +875,10 @@ case "${targ}" in targ_underscore=yes ;; + nios2-*-*)+ targ_defvec=bfd_elf32_littlenios2_vec+ ;;+ openrisc-*-elf) targ_defvec=bfd_elf32_openrisc_vec ;;--- binutils-2.15/bfd/configure 2004-05-17 21:35:57.000000000 +0200+++ binutils-2.15-nios2/bfd/configure 2005-05-17 12:20:13.000000000 +0200@@ -6322,6 +6322,7 @@ do bfd_elf32_mcore_little_vec) tb="$tb elf32-mcore.lo elf32.lo $elf" ;; bfd_elf32_mn10200_vec) tb="$tb elf-m10200.lo elf32.lo $elf" ;; bfd_elf32_mn10300_vec) tb="$tb elf-m10300.lo elf32.lo $elf" ;;+ bfd_elf32_littlenios2_vec) tb="$tb elf32-nios2.lo elf32.lo $elf" ;; bfd_elf32_msp430_vec) tb="$tb elf32-msp430.lo elf32.lo $elf" ;; bfd_elf32_nbigmips_vec) tb="$tb elfn32-mips.lo elfxx-mips.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;; bfd_elf32_nlittlemips_vec) tb="$tb elfn32-mips.lo elfxx-mips.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;;--- binutils-2.15/bfd/configure.in 2004-05-17 21:35:57.000000000 +0200+++ binutils-2.15-nios2/bfd/configure.in 2005-05-17 12:20:13.000000000 +0200@@ -631,6 +631,7 @@ do bfd_elf32_mcore_little_vec) tb="$tb elf32-mcore.lo elf32.lo $elf" ;; bfd_elf32_mn10200_vec) tb="$tb elf-m10200.lo elf32.lo $elf" ;; bfd_elf32_mn10300_vec) tb="$tb elf-m10300.lo elf32.lo $elf" ;;+ bfd_elf32_littlenios2_vec) tb="$tb elf32-nios2.lo elf32.lo $elf" ;; bfd_elf32_msp430_vec) tb="$tb elf32-msp430.lo elf32.lo $elf" ;; bfd_elf32_nbigmips_vec) tb="$tb elfn32-mips.lo elfxx-mips.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;; bfd_elf32_nlittlemips_vec) tb="$tb elfn32-mips.lo elfxx-mips.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;;--- binutils-2.15/bfd/cpu-nios2.c 1970-01-01 01:00:00.000000000 +0100+++ binutils-2.15-nios2/bfd/cpu-nios2.c 2005-05-17 12:20:13.000000000 +0200@@ -0,0 +1,70 @@+/* bfd back-end for Altera Nios II support++ Copyright (C) 2003+ by Nigel Gray (ngray@altera.com).+ +This file is part of BFD, the Binary File Descriptor library.++This program is free software; you can redistribute it and/or modify+it under the terms of the GNU General Public License as published by+the Free Software Foundation; either version 2 of the License, or+(at your option) any later version.++This program is distributed in the hope that it will be useful,+but WITHOUT ANY WARRANTY; without even the implied warranty of+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the+GNU General Public License for more details.++You should have received a copy of the GNU General Public License+along with this program; if not, write to the Free Software+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */++#include "bfd.h"+#include "sysdep.h"+#include "libbfd.h"++static const bfd_arch_info_type *nios2_compatible+ (const bfd_arch_info_type *, const bfd_arch_info_type *);++/* The default routine tests bits_per_word, which is wrong on mips as+ mips word size doesn't correlate with reloc size. */++static const bfd_arch_info_type *+nios2_compatible (const bfd_arch_info_type *a, const bfd_arch_info_type *b)+{+ if (a->arch != b->arch)+ return NULL;++ /* Machine compatibility is checked in+ _bfd_mips_elf_merge_private_bfd_data. */++ return a;+}++#define N(BITS_WORD, BITS_ADDR, NUMBER, PRINT, DEFAULT, NEXT) \+ { \+ BITS_WORD, /* bits in a word */ \+ BITS_ADDR, /* bits in an address */ \+ 8, /* 8 bits in a byte */ \+ bfd_arch_nios2, \+ NUMBER, \+ "nios2", \+ PRINT, \+ 3, \+ DEFAULT, \+ nios2_compatible, \+ bfd_default_scan, \+ NEXT, \+ }++#define NN(index) (&arch_info_struct[(index) + 1])++static const bfd_arch_info_type arch_info_struct[] =+{+ N (32, 32, bfd_mach_nios2, "nios2", FALSE, 0),+};++/* There is only one architecture - but we give the default a machine number of 0+ so the linker can distinguish it */+const bfd_arch_info_type bfd_nios2_arch =+N (32, 32, 0, "nios2", TRUE, &arch_info_struct[0]);--- binutils-2.15/bfd/elf.c 2004-05-17 21:35:57.000000000 +0200+++ binutils-2.15-nios2/bfd/elf.c 2005-05-17 12:20:13.000000000 +0200@@ -3286,9 +3286,14 @@ map_sections_to_segments (bfd *abfd) phdr_size = elf_tdata (abfd)->program_header_size; if (phdr_size == 0) phdr_size = get_elf_backend_data (abfd)->s->sizeof_phdr;++ /* NG - for standalone embedded applications we don't want the program+ headers or ELF header in the output memory map (cf CSP) */ if ((abfd->flags & D_PAGED) == 0 || sections[0]->lma < phdr_size- || sections[0]->lma % maxpagesize < phdr_size % maxpagesize)+ || sections[0]->lma % maxpagesize < phdr_size % maxpagesize+ || (elf_tdata (abfd)->elf_header[0].e_ident[EI_OSABI] + == ELFOSABI_STANDALONE)) phdr_in_segment = FALSE; }
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -