Browse Source

* emultempl/xtensaelf.em (is_inconsistent_linkonce_section): Add space

in dep_sec_name for null terminator.  Make sure dep_sec_name has a
	".t" linkonce tag.
cr-0x5f1
Bob Wilson 20 years ago
parent
commit
644143c8e1
  1. 6
      ld/ChangeLog
  2. 16
      ld/emultempl/xtensaelf.em

6
ld/ChangeLog

@ -1,3 +1,9 @@
2006-07-24 Bob Wilson <bob.wilson@acm.org>
* emultempl/xtensaelf.em (is_inconsistent_linkonce_section): Add space
in dep_sec_name for null terminator. Make sure dep_sec_name has a
".t" linkonce tag.
2006-07-14 Michael Wetherell <mike.wetherell@ntlworld.com> 2006-07-14 Michael Wetherell <mike.wetherell@ntlworld.com>
* emulparams/elf_x86_64.sh (LIBPATH_SUFFIX, ELF_INTERPRETER_NAME): * emulparams/elf_x86_64.sh (LIBPATH_SUFFIX, ELF_INTERPRETER_NAME):

16
ld/emultempl/xtensaelf.em

@ -1200,7 +1200,7 @@ is_inconsistent_linkonce_section (asection *sec)
{ {
bfd *abfd = sec->owner; bfd *abfd = sec->owner;
const char *sec_name = bfd_get_section_name (abfd, sec); const char *sec_name = bfd_get_section_name (abfd, sec);
char *prop_tag = 0; const char *name = 0;
if ((bfd_get_section_flags (abfd, sec) & SEC_LINK_ONCE) == 0 if ((bfd_get_section_flags (abfd, sec) & SEC_LINK_ONCE) == 0
|| strncmp (sec_name, ".gnu.linkonce.", linkonce_len) != 0) || strncmp (sec_name, ".gnu.linkonce.", linkonce_len) != 0)
@ -1208,20 +1208,20 @@ is_inconsistent_linkonce_section (asection *sec)
/* Check if this is an Xtensa property section. */ /* Check if this is an Xtensa property section. */
if (strncmp (sec_name + linkonce_len, "p.", 2) == 0) if (strncmp (sec_name + linkonce_len, "p.", 2) == 0)
prop_tag = "p."; name = sec_name + linkonce_len + 2;
else if (strncmp (sec_name + linkonce_len, "prop.", 5) == 0) else if (strncmp (sec_name + linkonce_len, "prop.", 5) == 0)
prop_tag = "prop."; name = strchr (sec_name + linkonce_len + 5, '.') + 1;
if (prop_tag)
if (name)
{ {
int tag_len = strlen (prop_tag); char *dep_sec_name = xmalloc (strlen (sec_name) + 1);
char *dep_sec_name = xmalloc (strlen (sec_name));
asection *dep_sec; asection *dep_sec;
/* Get the associated linkonce text section and check if it is /* Get the associated linkonce text section and check if it is
included in the link. If not, this section is inconsistent included in the link. If not, this section is inconsistent
and should be stripped. */ and should be stripped. */
strcpy (dep_sec_name, ".gnu.linkonce."); strcpy (dep_sec_name, ".gnu.linkonce.t.");
strcat (dep_sec_name, sec_name + linkonce_len + tag_len); strcat (dep_sec_name, name);
dep_sec = bfd_get_section_by_name (abfd, dep_sec_name); dep_sec = bfd_get_section_by_name (abfd, dep_sec_name);
if (dep_sec == NULL || ! input_section_linked (dep_sec)) if (dep_sec == NULL || ! input_section_linked (dep_sec))
{ {

Loading…
Cancel
Save