aboutsummaryrefslogtreecommitdiff
path: root/bfd/libbfd.c
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>1994-04-06 22:00:40 +0000
committerIan Lance Taylor <ian@airs.com>1994-04-06 22:00:40 +0000
commit6812b6077e4a09eab08458428f09c28ec58fc514 (patch)
tree16be3cd70ca281aca8b810d71fe5dbc125cbe9c9 /bfd/libbfd.c
parent76336d506d079ddae02f26752357b5ea94582cb0 (diff)
downloadbinutils-6812b6077e4a09eab08458428f09c28ec58fc514.zip
binutils-6812b6077e4a09eab08458428f09c28ec58fc514.tar.gz
binutils-6812b6077e4a09eab08458428f09c28ec58fc514.tar.bz2
* targets.c (bfd_target): Rearranged fields in target vector.
Removed _bfd_debug_info_start, _bfd_debug_info_end and _bfd_debug_info_accumulate, which were never used. (BFD_JUMP_TABLE_GENERIC, BFD_JUMP_TABLE_COPY): Defined. (BFD_JUMP_TABLE_CORE, BFD_JUMP_TABLE_ARCHIVE): Defined. (BFD_JUMP_TABLE_SYMBOLS, BFD_JUMP_TABLE_RELOCS): Defined. (BFD_JUMP_TABLE_WRITE, BFD_JUMP_TABLE_LINK): Defined. * All backends: Changed to use the new BFD_JUMP_TABLE_* macros rather than the single JUMP_TABLE macro. Removed many of the weird macro definitions needed to support the monolithic JUMP_TABLE. * bfd-in.h (JUMP_TABLE): Removed. * libbfd-in.h: Define a bunch of macros, and declare a few functions, for use with the new BFD_JUMP_TABLE_* macros. * libbfd.c (_bfd_dummy_new_section_hook): Removed. (bfd_false): Set bfd_error_invalid_operation. (bfd_nullvoidptr): Likewise. (bfd_n1): New function. (_bfd_nocore_core_file_matches_executable_p): Renamed from _bfd_dummy_core_file_matches_executable_p. (_bfd_nocore_core_file_failing_command): Similar rename. Set bfd_error_invalid_operation. (_bfd_nocore_core_file_failing_signal): Likewise. (_bfd_generic_get_section_contents): Renamed from bfd_generic_get_section_contents. Changed all callers. (_bfd_generic_set_section_contents): Similar rename. * ieee.c: #if 0 out ieee_bfd_debug_info_start, ieee_bfd_debug_info_end, ieee_bfd_debug_info_accumulate. They were never called. * bfd-in2.h: Rebuilt. * libbfd.h: Rebuilt.
Diffstat (limited to 'bfd/libbfd.c')
-rw-r--r--bfd/libbfd.c50
1 files changed, 35 insertions, 15 deletions
diff --git a/bfd/libbfd.c b/bfd/libbfd.c
index 93522d9..2925754 100644
--- a/bfd/libbfd.c
+++ b/bfd/libbfd.c
@@ -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*/
@@ -89,6 +91,18 @@ bfd_0l (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)
@@ -98,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;
{
@@ -106,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;
}
@@ -787,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;
@@ -808,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;