This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Fix PR 51.
- From: Alan Modra <amodra at bigpond dot net dot au>
- To: binutils at sources dot redhat dot com
- Cc: Andreas Schwab <schwab at suse dot de>
- Date: Tue, 23 Mar 2004 09:25:46 +1030
- Subject: Fix PR 51.
Fixes PR 51. Another reason why those powerpc64-linux dot symbols must
go. Strictly speaking, wrap_char belongs struct bfd_target because it's
a property of the input bfd, but this is good enough.
Applying mainline and 2.15.
include/ChangeLog
* bfdlink.h (struct bfd_link_info): Add wrap_char.
bfd/ChangeLog
* linker.c (bfd_wrapped_link_hash_lookup): Handle info->wrap_char.
ld/ChangeLog
* emultempl/ppc64elf.em (ppc_create_output_section_statements): Set
link_info.wrap_char.
Index: include/bfdlink.h
===================================================================
RCS file: /cvs/src/src/include/bfdlink.h,v
retrieving revision 1.41
diff -u -p -r1.41 bfdlink.h
--- include/bfdlink.h 20 Mar 2004 23:16:43 -0000 1.41
+++ include/bfdlink.h 22 Mar 2004 22:35:14 -0000
@@ -323,6 +323,11 @@ struct bfd_link_info
whether to include an object from an archive. */
enum bfd_link_common_skip_ar_aymbols common_skip_ar_aymbols;
+ /* Char that may appear as the first char of a symbol, but should be
+ skipped (like symbol_leading_char) when looking up symbols in
+ wrap_hash. Used by PowerPC Linux for 'dot' symbols. */
+ char wrap_char;
+
/* Function callbacks. */
const struct bfd_link_callbacks *callbacks;
Index: bfd/linker.c
===================================================================
RCS file: /cvs/src/src/bfd/linker.c,v
retrieving revision 1.34
diff -u -p -r1.34 linker.c
--- bfd/linker.c 2 Dec 2003 22:59:59 -0000 1.34
+++ bfd/linker.c 22 Mar 2004 22:34:57 -0000
@@ -523,10 +523,14 @@ bfd_wrapped_link_hash_lookup (bfd *abfd,
if (info->wrap_hash != NULL)
{
const char *l;
+ char prefix = '\0';
l = string;
- if (*l == bfd_get_symbol_leading_char (abfd))
- ++l;
+ if (*l == bfd_get_symbol_leading_char (abfd) || *l == info->wrap_char)
+ {
+ prefix = *l;
+ ++l;
+ }
#undef WRAP
#define WRAP "__wrap_"
@@ -544,8 +548,7 @@ bfd_wrapped_link_hash_lookup (bfd *abfd,
if (n == NULL)
return NULL;
- /* Note that symbol_leading_char may be '\0'. */
- n[0] = bfd_get_symbol_leading_char (abfd);
+ n[0] = prefix;
n[1] = '\0';
strcat (n, WRAP);
strcat (n, l);
@@ -576,8 +579,7 @@ bfd_wrapped_link_hash_lookup (bfd *abfd,
if (n == NULL)
return NULL;
- /* Note that symbol_leading_char may be '\0'. */
- n[0] = bfd_get_symbol_leading_char (abfd);
+ n[0] = prefix;
n[1] = '\0';
strcat (n, l + sizeof REAL - 1);
h = bfd_link_hash_lookup (info->hash, n, create, TRUE, follow);
Index: ld/emultempl/ppc64elf.em
===================================================================
RCS file: /cvs/src/src/ld/emultempl/ppc64elf.em,v
retrieving revision 1.25
diff -u -p -r1.25 ppc64elf.em
--- ld/emultempl/ppc64elf.em 9 Jan 2004 05:36:30 -0000 1.25
+++ ld/emultempl/ppc64elf.em 22 Mar 2004 22:35:16 -0000
@@ -65,6 +65,8 @@ ppc_create_output_section_statements (vo
&& link_info.hash->creator != &bfd_elf64_powerpcle_vec)
return;
+ link_info.wrap_char = '.';
+
stub_file = lang_add_input_file ("linker stubs",
lang_input_file_is_fake_enum,
NULL);
--
Alan Modra
IBM OzLabs - Linux Technology Centre