From 67010b4679cde27a16ba60f1ff8ec1d502a6d681 Mon Sep 17 00:00:00 2001 From: Nick Clifton Date: Mon, 2 Sep 2002 17:03:30 +0000 Subject: [PATCH] Add EXTERN references to __ctbpm __gp and __ep. Define TEMPLATE_NAME. Revert bogus change to ldexp.c --- ld/ChangeLog | 6 +++--- ld/emulparams/v850.sh | 1 + ld/ldexp.c | 24 +++++++++++++----------- ld/scripttempl/v850.sc | 1 + 4 files changed, 18 insertions(+), 14 deletions(-) diff --git a/ld/ChangeLog b/ld/ChangeLog index f097310..4a3abd9 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,8 +1,8 @@ 2002-09-02 Nick Clifton - * ldexp.c (exp_fold_tree): If the first attempt to lookup a - PROVIDEd symbol fails, look it up again, but this time with - the 'create' flag set. + * scripttempl/v850.sc: Add EXTERN references to __ctbpm __gp and + __ep. + * emulparams/v850.sh (TEMPLATE_NAME): Define. 2002-08-30 Nick Clifton diff --git a/ld/emulparams/v850.sh b/ld/emulparams/v850.sh index 78bfbd3..96cdc68 100644 --- a/ld/emulparams/v850.sh +++ b/ld/emulparams/v850.sh @@ -12,3 +12,4 @@ ARCH=v850 MAXPAGESIZE=256 ENTRY=_start EMBEDDED=yes +TEMPLATE_NAME=elf32 diff --git a/ld/ldexp.c b/ld/ldexp.c index 6c4937d..8e3ea63 100644 --- a/ld/ldexp.c +++ b/ld/ldexp.c @@ -726,20 +726,22 @@ exp_fold_tree (tree, current_section, allocation_done, dot, dotp) if (tree->type.node_class == etree_assign) create = true; else - create = false; + create = false; h = bfd_link_hash_lookup (link_info.hash, tree->assign.dst, create, false, false); - - if (tree->type.node_class == etree_provide - && (h == NULL - || h->type == bfd_link_hash_undefined - || h->type == bfd_link_hash_common)) - h = bfd_link_hash_lookup (link_info.hash, tree->assign.dst, - true, false, false); - if (h == (struct bfd_link_hash_entry *) NULL) - einfo (_("%P%F:%s: hash creation failed\n"), - tree->assign.dst); + { + if (tree->type.node_class == etree_assign) + einfo (_("%P%F:%s: hash creation failed\n"), + tree->assign.dst); + } + else if (tree->type.node_class == etree_provide + && h->type != bfd_link_hash_undefined + && h->type != bfd_link_hash_common) + { + /* Do nothing. The symbol was defined by some + object. */ + } else { /* FIXME: Should we worry if the symbol is already diff --git a/ld/scripttempl/v850.sc b/ld/scripttempl/v850.sc index 8958321..18ba03a 100644 --- a/ld/scripttempl/v850.sc +++ b/ld/scripttempl/v850.sc @@ -4,6 +4,7 @@ OUTPUT_FORMAT("elf32-v850", "elf32-v850", OUTPUT_ARCH(v850) ENTRY(_start) SEARCH_DIR(.); +EXTERN(__ctbp __ep __gp); SECTIONS { /* This saves a little space in the ELF file, since the zda starts -- 2.7.4