From: jtc@redback.com (J.T. Conklin)
To: Ian Lance Taylor <ian@airs.com>
Cc: binutils@sourceware.cygnus.com
Subject: Re: identifier mangling when linking binary "blobs"
Date: Thu, 01 Jul 1999 00:00:00 -0000 [thread overview]
Message-ID: <5mn1yopyp7.fsf@jtc.redbacknetworks.com> (raw)
In-Reply-To: <19990522023057.13861.qmail@daffy.airs.com>
>>>>> "Ian" == Ian Lance Taylor <ian@airs.com> writes:
Ian> I think it's a bug. mangle_name in binary.c should prepend
Ian> bfd_get_symbol_leading_char (abfd). That should make the name
Ian> consistently start with an underscore, which I think is correct.
I finally got a chance to follow up, and came up with the enclosed
patch. Unfortunately, it doesn't work as expected. As bfd_get_
symbol_leading_char(abfd) returns the leading character of the
"binary" BFD vector instead of that the output file.
After poking around for a while, I could not find a way for
mangle_name() to get that info without causing major damage.
Any ideas?
--jtc
Index: binary.c
===================================================================
RCS file: /cvs/binutils/binutils/bfd/binary.c,v
retrieving revision 1.1.1.1
diff -c -r1.1.1.1 binary.c
*** binary.c 1999/05/03 07:28:55 1.1.1.1
--- binary.c 1999/05/28 23:15:16
***************
*** 143,149 ****
char *buf;
char *p;
! size = (strlen (bfd_get_filename (abfd))
+ strlen (suffix)
+ sizeof "_binary__");
--- 143,150 ----
char *buf;
char *p;
! size = ( (bfd_get_symbol_leading_char(abfd) != 0)
! + strlen (bfd_get_filename (abfd))
+ strlen (suffix)
+ sizeof "_binary__");
***************
*** 151,157 ****
if (buf == NULL)
return "";
! sprintf (buf, "_binary_%s_%s", bfd_get_filename (abfd), suffix);
/* Change any non-alphanumeric characters to underscores. */
for (p = buf; *p; p++)
--- 152,163 ----
if (buf == NULL)
return "";
! /* Note that symbol_leading_char may be '\0'. */
! buf[0] = bfd_get_symbol_leading_char(abfd);
! buf[1] = 0;
! p = buf + strlen(buf);
!
! sprintf (p, "_binary_%s_%s", bfd_get_filename (abfd), suffix);
/* Change any non-alphanumeric characters to underscores. */
for (p = buf; *p; p++)
--
J.T. Conklin
RedBack Networks
next prev parent reply other threads:[~1999-07-01 0:00 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
1999-07-01 0:00 J.T. Conklin
1999-07-01 0:00 ` Ian Lance Taylor
1999-07-01 0:00 ` J.T. Conklin [this message]
1999-07-01 0:00 ` Ian Lance Taylor
1999-07-01 0:00 ` J.T. Conklin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5mn1yopyp7.fsf@jtc.redbacknetworks.com \
--to=jtc@redback.com \
--cc=binutils@sourceware.cygnus.com \
--cc=ian@airs.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).