Warn if GOT16 overflows.
[deliverable/binutils-gdb.git] / bfd / libbfd.c
index fe441c8d583b1e7f57e23675d5182e8be8b598f5..2925754cbd764056afb3f60adae26449ceabb478 100644 (file)
@@ -32,23 +32,21 @@ DESCRIPTION
        completeness.
 */
 
-/*ARGSUSED*/
-boolean
-_bfd_dummy_new_section_hook (ignore, ignore_newsect)
-     bfd *ignore;
-     asection *ignore_newsect;
-{
-  return true;
-}
+/* A routine which is used in target vectors for unsupported
+   operations.  */
 
 /*ARGSUSED*/
 boolean
 bfd_false (ignore)
      bfd *ignore;
 {
+  bfd_set_error (bfd_error_invalid_operation);
   return false;
 }
 
+/* A routine which is used in target vectors for supported operations
+   which do not actually do anything.  */
+
 /*ARGSUSED*/
 boolean
 bfd_true (ignore)
@@ -57,12 +55,16 @@ bfd_true (ignore)
   return true;
 }
 
+/* A routine which is used in target vectors for unsupported
+   operations which return a pointer value.  */
+
 /*ARGSUSED*/
 PTR
 bfd_nullvoidptr (ignore)
      bfd *ignore;
 {
-  return (PTR)NULL;
+  bfd_set_error (bfd_error_invalid_operation);
+  return NULL;
 }
 
 /*ARGSUSED*/
@@ -81,6 +83,26 @@ bfd_0u (ignore)
    return 0;
 }
 
+/*ARGUSED*/
+long
+bfd_0l (ignore)
+     bfd *ignore;
+{
+  return 0;
+}
+
+/* A routine which is used in target vectors for unsupported
+   operations which return -1 on error.  */
+
+/*ARGSUSED*/
+long
+_bfd_n1 (ignore_abfd)
+     bfd *ignore_abfd;
+{
+  bfd_set_error (bfd_error_invalid_operation);
+  return -1;
+}
+
 /*ARGSUSED*/
 void 
 bfd_void (ignore)
@@ -90,7 +112,7 @@ bfd_void (ignore)
 
 /*ARGSUSED*/
 boolean
-_bfd_dummy_core_file_matches_executable_p (ignore_core_bfd, ignore_exec_bfd)
+_bfd_nocore_core_file_matches_executable_p (ignore_core_bfd, ignore_exec_bfd)
      bfd *ignore_core_bfd;
      bfd *ignore_exec_bfd;
 {
@@ -98,21 +120,27 @@ _bfd_dummy_core_file_matches_executable_p (ignore_core_bfd, ignore_exec_bfd)
   return false;
 }
 
-/* of course you can't initialize a function to be the same as another, grr */
+/* Routine to handle core_file_failing_command entry point for targets
+   without core file support.  */
 
 /*ARGSUSED*/
 char *
-_bfd_dummy_core_file_failing_command (ignore_abfd)
+_bfd_nocore_core_file_failing_command (ignore_abfd)
      bfd *ignore_abfd;
 {
+  bfd_set_error (bfd_error_invalid_operation);
   return (char *)NULL;
 }
 
+/* Routine to handle core_file_failing_signal entry point for targets
+   without core file support.  */
+
 /*ARGSUSED*/
 int
-_bfd_dummy_core_file_failing_signal (ignore_abfd)
+_bfd_nocore_core_file_failing_signal (ignore_abfd)
      bfd *ignore_abfd;
 {
+  bfd_set_error (bfd_error_invalid_operation);
   return 0;
 }
 
@@ -240,7 +268,8 @@ bfd_write_bigendian_4byte_int (abfd, i)
 {
   bfd_byte buffer[4];
   bfd_putb32(i, buffer);
-  bfd_write((PTR)buffer, 4, 1, abfd);
+  if (bfd_write((PTR)buffer, 4, 1, abfd) != 4)
+    abort ();
 }
 
 long
@@ -778,7 +807,7 @@ bfd_putl64 (data, addr)
 /* Default implementation */
 
 boolean
-bfd_generic_get_section_contents (abfd, section, location, offset, count)
+_bfd_generic_get_section_contents (abfd, section, location, offset, count)
      bfd *abfd;
      sec_ptr section;
      PTR location;
@@ -799,7 +828,7 @@ bfd_generic_get_section_contents (abfd, section, location, offset, count)
    in read-write files, though.  See other set_section_contents functions
    to see why it doesn't work for new sections.  */
 boolean
-bfd_generic_set_section_contents (abfd, section, location, offset, count)
+_bfd_generic_set_section_contents (abfd, section, location, offset, count)
      bfd *abfd;
      sec_ptr section;
      PTR location;
This page took 0.037476 seconds and 4 git commands to generate.