X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=bfd%2Fppcboot.c;h=50ac2d3cb3dd2361ec0cff9a44549747674c1406;hb=a05b22b6c7ff0f48b92086f523f8227d26c84f49;hp=9d9d187613a1cd85ef406dce89ffe63c24343931;hpb=cb001c0d283dd884efe06770d033a50fb1bc6c7d;p=binutils-gdb.git diff --git a/bfd/ppcboot.c b/bfd/ppcboot.c index 9d9d187613a..50ac2d3cb3d 100644 --- a/bfd/ppcboot.c +++ b/bfd/ppcboot.c @@ -1,5 +1,5 @@ /* BFD back-end for PPCbug boot records. - Copyright (C) 1996-2020 Free Software Foundation, Inc. + Copyright (C) 1996-2023 Free Software Foundation, Inc. Written by Michael Meissner, Cygnus Support, This file is part of BFD, the Binary File Descriptor library. @@ -97,7 +97,7 @@ typedef struct ppcboot_data /* Create a ppcboot object. Invoked via bfd_set_format. */ -static bfd_boolean +static bool ppcboot_mkobject (bfd *abfd) { if (!ppcboot_get_tdata (abfd)) @@ -106,12 +106,12 @@ ppcboot_mkobject (bfd *abfd) ppcboot_set_tdata (abfd, bfd_zalloc (abfd, amt)); } - return TRUE; + return true; } /* Set the architecture to PowerPC */ -static bfd_boolean +static bool ppcboot_set_arch_mach (bfd *abfd, enum bfd_architecture arch, unsigned long machine) @@ -120,7 +120,7 @@ ppcboot_set_arch_mach (bfd *abfd, arch = bfd_arch_powerpc; else if (arch != bfd_arch_powerpc) - return FALSE; + return false; return bfd_default_set_arch_mach (abfd, arch, machine); } @@ -161,8 +161,7 @@ ppcboot_object_p (bfd *abfd) return NULL; } - if (bfd_bread (&hdr, (bfd_size_type) sizeof (hdr), abfd) - != sizeof (hdr)) + if (bfd_read (&hdr, sizeof (hdr), abfd) != sizeof (hdr)) { if (bfd_get_error () != bfd_error_system_call) bfd_set_error (bfd_error_wrong_format); @@ -217,17 +216,17 @@ ppcboot_object_p (bfd *abfd) /* Get contents of the only section. */ -static bfd_boolean +static bool ppcboot_get_section_contents (bfd *abfd, asection *section ATTRIBUTE_UNUSED, void * location, file_ptr offset, bfd_size_type count) { - if (bfd_seek (abfd, offset + (file_ptr) sizeof (ppcboot_hdr_t), SEEK_SET) != 0 - || bfd_bread (location, count, abfd) != count) - return FALSE; - return TRUE; + if (bfd_seek (abfd, offset + sizeof (ppcboot_hdr_t), SEEK_SET) != 0 + || bfd_read (location, count, abfd) != count) + return false; + return true; } @@ -280,7 +279,7 @@ ppcboot_canonicalize_symtab (bfd *abfd, asymbol **alocation) syms = (asymbol *) bfd_alloc (abfd, amt); if (syms == NULL) - return FALSE; + return false; /* Start symbol. */ syms[0].the_bfd = abfd; @@ -332,6 +331,7 @@ ppcboot_get_symbol_info (bfd *ignore_abfd ATTRIBUTE_UNUSED, #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_nearest_line_with_alt _bfd_nosymbols_find_nearest_line_with_alt #define ppcboot_find_line _bfd_nosymbols_find_line #define ppcboot_find_inliner_info _bfd_nosymbols_find_inliner_info #define ppcboot_bfd_make_debug_symbol _bfd_nosymbols_bfd_make_debug_symbol @@ -340,7 +340,7 @@ ppcboot_get_symbol_info (bfd *ignore_abfd ATTRIBUTE_UNUSED, /* Write section contents of a ppcboot file. */ -static bfd_boolean +static bool ppcboot_set_section_contents (bfd *abfd, asection *sec, const void * data, @@ -363,7 +363,7 @@ ppcboot_set_section_contents (bfd *abfd, for (s = abfd->sections; s != NULL; s = s->next) s->filepos = s->vma - low; - abfd->output_has_begun = TRUE; + abfd->output_has_begun = true; } return _bfd_generic_set_section_contents (abfd, sec, data, offset, size); @@ -380,7 +380,7 @@ ppcboot_sizeof_headers (bfd *abfd ATTRIBUTE_UNUSED, /* Print out the program headers. */ -static bfd_boolean +static bool ppcboot_bfd_print_private_bfd_data (bfd *abfd, void * farg) { FILE *f = (FILE *)farg; @@ -445,7 +445,7 @@ ppcboot_bfd_print_private_bfd_data (bfd *abfd, void * farg) } fprintf (f, "\n"); - return TRUE; + return true; } @@ -495,6 +495,7 @@ const bfd_target powerpc_boot_vec = ' ', /* ar_pad_char */ 16, /* ar_max_namelen */ 0, /* match priority. */ + TARGET_KEEP_UNUSED_SECTION_SYMBOLS, /* keep unused section symbols. */ bfd_getb64, bfd_getb_signed_64, bfd_putb64, bfd_getb32, bfd_getb_signed_32, bfd_putb32, bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* data */