X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=bfd%2Fppcboot.c;h=d51280c8d8a6f4c7653a349c841a0782bb722afd;hb=6bba1048d63e0476b94b9934527defd81c590a13;hp=49f81402149e72f8551ee5187fdd0fb2ab0e4c55;hpb=082b7297014d9ccc3990c3c6be689dd18946d826;p=deliverable%2Fbinutils-gdb.git diff --git a/bfd/ppcboot.c b/bfd/ppcboot.c index 49f8140214..d51280c8d8 100644 --- a/bfd/ppcboot.c +++ b/bfd/ppcboot.c @@ -1,23 +1,25 @@ /* BFD back-end for PPCbug boot records. - Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 - Free Software Foundation, Inc. + Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2006, + 2007, 2008 Free Software Foundation, Inc. Written by Michael Meissner, Cygnus Support, -This file is part of BFD, the Binary File Descriptor library. + 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 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 3 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. + 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., 51 Franklin Street - Fifth Floor, Boston, + MA 02110-1301, USA. */ -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. */ /* This is a BFD backend which may be used to write PowerPCBug boot objects. It may only be used for output, not input. The intention is that this may @@ -32,9 +34,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ the file. objcopy cooperates by specially setting the start address to zero by default. */ +#include "sysdep.h" #include "safe-ctype.h" #include "bfd.h" -#include "sysdep.h" #include "libbfd.h" /* PPCbug location structure */ @@ -99,7 +101,6 @@ static long ppcboot_canonicalize_symtab PARAMS ((bfd *, asymbol **)); static void ppcboot_get_symbol_info PARAMS ((bfd *, asymbol *, symbol_info *)); static bfd_boolean ppcboot_set_section_contents PARAMS ((bfd *, asection *, const PTR, file_ptr, bfd_size_type)); -static int ppcboot_sizeof_headers PARAMS ((bfd *, bfd_boolean)); static bfd_boolean ppcboot_bfd_print_private_bfd_data PARAMS ((bfd *, PTR)); #define ppcboot_set_tdata(abfd, ptr) ((abfd)->tdata.any = (PTR) (ptr)) @@ -151,6 +152,7 @@ ppcboot_object_p (abfd) ppcboot_hdr_t hdr; size_t i; ppcboot_data_t *tdata; + flagword flags; BFD_ASSERT (sizeof (ppcboot_hdr_t) == 1024); @@ -205,10 +207,10 @@ ppcboot_object_p (abfd) abfd->symcount = PPCBOOT_SYMS; /* One data section. */ - sec = bfd_make_section (abfd, ".data"); + flags = SEC_ALLOC | SEC_LOAD | SEC_DATA | SEC_CODE | SEC_HAS_CONTENTS; + sec = bfd_make_section_with_flags (abfd, ".data", flags); if (sec == NULL) return NULL; - sec->flags = SEC_ALLOC | SEC_LOAD | SEC_DATA | SEC_CODE | SEC_HAS_CONTENTS; sec->vma = 0; sec->size = statbuf.st_size - sizeof (ppcboot_hdr_t); sec->filepos = sizeof (ppcboot_hdr_t); @@ -345,18 +347,15 @@ ppcboot_get_symbol_info (ignore_abfd, symbol, ret) bfd_symbol_info (symbol, ret); } +#define ppcboot_bfd_is_target_special_symbol \ + ((bfd_boolean (*) (bfd *, asymbol *)) bfd_false) #define ppcboot_bfd_is_local_label_name bfd_generic_is_local_label_name #define ppcboot_get_lineno _bfd_nosymbols_get_lineno #define ppcboot_find_nearest_line _bfd_nosymbols_find_nearest_line +#define ppcboot_find_inliner_info _bfd_nosymbols_find_inliner_info #define ppcboot_bfd_make_debug_symbol _bfd_nosymbols_bfd_make_debug_symbol #define ppcboot_read_minisymbols _bfd_generic_read_minisymbols #define ppcboot_minisymbol_to_symbol _bfd_generic_minisymbol_to_symbol - -#define ppcboot_get_reloc_upper_bound \ - ((long (*) PARAMS ((bfd *, asection *))) bfd_0l) -#define ppcboot_canonicalize_reloc \ - ((long (*) PARAMS ((bfd *, asection *, arelent **, asymbol **))) bfd_0l) -#define ppcboot_bfd_reloc_type_lookup _bfd_norelocs_bfd_reloc_type_lookup /* Write section contents of a ppcboot file. */ @@ -392,9 +391,8 @@ ppcboot_set_section_contents (abfd, sec, data, offset, size) static int -ppcboot_sizeof_headers (abfd, exec) - bfd *abfd ATTRIBUTE_UNUSED; - bfd_boolean exec ATTRIBUTE_UNUSED; +ppcboot_sizeof_headers (bfd *abfd ATTRIBUTE_UNUSED, + struct bfd_link_info *info ATTRIBUTE_UNUSED) { return sizeof (ppcboot_hdr_t); } @@ -414,8 +412,10 @@ ppcboot_bfd_print_private_bfd_data (abfd, farg) int i; fprintf (f, _("\nppcboot header:\n")); - fprintf (f, _("Entry offset = 0x%.8lx (%ld)\n"), entry_offset, entry_offset); - fprintf (f, _("Length = 0x%.8lx (%ld)\n"), length, length); + fprintf (f, _("Entry offset = 0x%.8lx (%ld)\n"), + (unsigned long) entry_offset, entry_offset); + fprintf (f, _("Length = 0x%.8lx (%ld)\n"), + (unsigned long) length, length); if (tdata->header.flags) fprintf (f, _("Flag field = 0x%.2x\n"), tdata->header.flags); @@ -455,8 +455,10 @@ ppcboot_bfd_print_private_bfd_data (abfd, farg) tdata->header.partition[i].partition_end.sector, tdata->header.partition[i].partition_end.cylinder); - fprintf (f, _("Partition[%d] sector = 0x%.8lx (%ld)\n"), i, sector_begin, sector_begin); - fprintf (f, _("Partition[%d] length = 0x%.8lx (%ld)\n"), i, sector_length, sector_length); + fprintf (f, _("Partition[%d] sector = 0x%.8lx (%ld)\n"), + i, (unsigned long) sector_begin, sector_begin); + fprintf (f, _("Partition[%d] length = 0x%.8lx (%ld)\n"), + i, (unsigned long) sector_length, sector_length); } fprintf (f, "\n"); @@ -532,7 +534,7 @@ const bfd_target ppcboot_vec = BFD_JUMP_TABLE_CORE (_bfd_nocore), BFD_JUMP_TABLE_ARCHIVE (_bfd_noarchive), BFD_JUMP_TABLE_SYMBOLS (ppcboot), - BFD_JUMP_TABLE_RELOCS (ppcboot), + BFD_JUMP_TABLE_RELOCS (_bfd_norelocs), BFD_JUMP_TABLE_WRITE (ppcboot), BFD_JUMP_TABLE_LINK (ppcboot), BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),