aboutsummaryrefslogtreecommitdiff
path: root/bfd/cofflink.c
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>1995-09-14 19:03:21 +0000
committerIan Lance Taylor <ian@airs.com>1995-09-14 19:03:21 +0000
commita208a70f7a1a3418b11203867843fb2218c15d02 (patch)
tree95f1c1d349d0b2db42c5244ad1b7bf557316c45b /bfd/cofflink.c
parent4814df240eaff8078a63a412ac405709bd168455 (diff)
downloadgdb-a208a70f7a1a3418b11203867843fb2218c15d02.zip
gdb-a208a70f7a1a3418b11203867843fb2218c15d02.tar.gz
gdb-a208a70f7a1a3418b11203867843fb2218c15d02.tar.bz2
Convert i960 COFF to use COFF backend linker.
* coff-i960.c (coff_i960_relocate): Use a coff_section_data structure to store the symbol being used. (coff_i960_start_final_link): New static function. (coff_i960_relocate_section): New static function. (coff_i960_adjust_symndx): New static function. (coff_start_final_link): Define. (coff_relocate_section): Define. (coff_adjust_symndx): Define. * coffcode.h (bfd_coff_backend_data): Add new callback function _bfd_coff_start_final_link. (bfd_coff_start_final_link): Define. (coff_start_final_link): Define if not defined. (bfd_coff_std_swap_table): Add coff_start_final_link. * cofflink.c (_bfd_coff_internal_syment_name): Make globally visible. (_bfd_coff_final_link): Call bfd_coff_start_final_link if the function callback is not NULL. * libcoff-in.h (struct coff_section_tdata): Add tdata field. (_bfd_coff_internal_syment_name): Declare. * libcoff.h: Rebuild. * configure.in (icoff_big_vec): Add cofflink.o. (icoff_little_vec): Likewise. * configure: Rebuild.
Diffstat (limited to 'bfd/cofflink.c')
-rw-r--r--bfd/cofflink.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/bfd/cofflink.c b/bfd/cofflink.c
index 10c0d68..81cefb0 100644
--- a/bfd/cofflink.c
+++ b/bfd/cofflink.c
@@ -87,8 +87,6 @@ static boolean coff_link_add_object_symbols
PARAMS ((bfd *, struct bfd_link_info *));
static boolean coff_link_check_archive_element
PARAMS ((bfd *, struct bfd_link_info *, boolean *));
-static INLINE const char *_bfd_coff_internal_syment_name
- PARAMS ((bfd *, const struct internal_syment *, char *));
static boolean coff_link_check_ar_symbols
PARAMS ((bfd *, struct bfd_link_info *, boolean *));
static boolean coff_link_add_symbols PARAMS ((bfd *, struct bfd_link_info *));
@@ -238,7 +236,7 @@ coff_link_check_archive_element (abfd, info, pneeded)
/* Get the name of a symbol. The caller must pass in a buffer of size
>= SYMNMLEN + 1. */
-static INLINE const char *
+INLINE const char *
_bfd_coff_internal_syment_name (abfd, sym, buf)
bfd *abfd;
const struct internal_syment *sym;
@@ -710,6 +708,13 @@ _bfd_coff_final_link (abfd, info)
table in memory as we go along. We process all the relocations
for a single input file at once. */
obj_raw_syment_count (abfd) = 0;
+
+ if (coff_backend_info (abfd)->_bfd_coff_start_final_link)
+ {
+ if (! bfd_coff_start_final_link (abfd, info))
+ goto error_return;
+ }
+
for (o = abfd->sections; o != NULL; o = o->next)
{
for (p = o->link_order_head; p != NULL; p = p->next)