* ldlang.c (lang_register_vers_node): Only check globals<=>locals,

since we need to be able to export different versions of the same
        symbol.
This commit is contained in:
Richard Henderson 1997-10-17 07:05:05 +00:00
parent bccab6306f
commit b038ec7bd9
2 changed files with 41 additions and 23 deletions

View file

@ -1,3 +1,9 @@
Fri Oct 17 00:00:13 1997 Richard Henderson <rth@cygnus.com>
* ldlang.c (lang_register_vers_node): Only check globals<=>locals,
since we need to be able to export different versions of the same
symbol.
Wed Oct 15 14:52:36 1997 Ian Lance Taylor <ian@cygnus.com> Wed Oct 15 14:52:36 1997 Ian Lance Taylor <ian@cygnus.com>
* scripttempl/pe.sc: Put .stab and .stabstr sections at end. * scripttempl/pe.sc: Put .stab and .stabstr sections at end.

View file

@ -413,7 +413,7 @@ lang_memory_region_lookup (name)
CONST char *CONST name; CONST char *CONST name;
{ {
lang_memory_region_type *p = lang_memory_region_list; lang_memory_region_type *p;
for (p = lang_memory_region_list; for (p = lang_memory_region_list;
p != (lang_memory_region_type *) NULL; p != (lang_memory_region_type *) NULL;
@ -804,10 +804,17 @@ wild_doit (ptr, section, output, file)
if (section->output_section == NULL) if (section->output_section == NULL)
{ {
boolean first;
lang_input_section_type *new; lang_input_section_type *new;
flagword flags;
if (output->bfd_section == NULL) if (output->bfd_section == NULL)
init_os (output); {
init_os (output);
first = true;
}
else
first = false;
/* Add a section reference to the list */ /* Add a section reference to the list */
new = new_stat (lang_input_section, ptr); new = new_stat (lang_input_section, ptr);
@ -816,23 +823,38 @@ wild_doit (ptr, section, output, file)
new->ifile = file; new->ifile = file;
section->output_section = output->bfd_section; section->output_section = output->bfd_section;
flags = section->flags;
/* We don't copy the SEC_NEVER_LOAD flag from an input section /* We don't copy the SEC_NEVER_LOAD flag from an input section
to an output section, because we want to be able to include a to an output section, because we want to be able to include a
SEC_NEVER_LOAD section in the middle of an otherwise loaded SEC_NEVER_LOAD section in the middle of an otherwise loaded
section (I don't know why we want to do this, but we do). section (I don't know why we want to do this, but we do).
build_link_order in ldwrite.c handles this case by turning build_link_order in ldwrite.c handles this case by turning
the embedded SEC_NEVER_LOAD section into a fill. the embedded SEC_NEVER_LOAD section into a fill. */
If final link, don't copy the SEC_LINK_ONCE flags, they've already flags &= ~ SEC_NEVER_LOAD;
been processed. One reason to do this is that on pe format targets,
.text$foo sections go into .text and it's odd to see .text with
SEC_LINK_ONCE set. */
section->output_section->flags |= /* If final link, don't copy the SEC_LINK_ONCE flags, they've
section->flags & (flagword) (~ (SEC_NEVER_LOAD already been processed. One reason to do this is that on pe
| (! link_info.relocateable format targets, .text$foo sections go into .text and it's odd
? SEC_LINK_ONCE | SEC_LINK_DUPLICATES to see .text with SEC_LINK_ONCE set. */
: 0)));
if (! link_info.relocateable)
flags &= ~ (SEC_LINK_ONCE | SEC_LINK_DUPLICATES);
/* If this is not the first input section, and the SEC_READONLY
flag is not currently set, then don't set it just because the
input section has it set. */
if (! first && (section->output_section->flags & SEC_READONLY) == 0)
flags &= ~ SEC_READONLY;
section->output_section->flags |= flags;
/* If SEC_READONLY is not set in the input section, then clear
it from the output section. */
if ((section->flags & SEC_READONLY) == 0)
section->output_section->flags &= ~SEC_READONLY;
switch (output->sectype) switch (output->sectype)
{ {
@ -845,7 +867,7 @@ wild_doit (ptr, section, output, file)
output->bfd_section->flags &= ~SEC_ALLOC; output->bfd_section->flags &= ~SEC_ALLOC;
break; break;
case noload_section: case noload_section:
output->bfd_section->flags &= ~ (SEC_LOAD | SEC_HAS_CONTENTS); output->bfd_section->flags &= ~SEC_LOAD;
output->bfd_section->flags |= SEC_NEVER_LOAD; output->bfd_section->flags |= SEC_NEVER_LOAD;
break; break;
} }
@ -3921,11 +3943,6 @@ lang_register_vers_node (name, version, deps)
{ {
struct bfd_elf_version_expr *e2; struct bfd_elf_version_expr *e2;
for (e2 = t->globals; e2 != NULL; e2 = e2->next)
if (strcmp (e1->match, e2->match) == 0)
einfo ("%X%P: duplicate expression `%s' in version information\n",
e1->match);
for (e2 = t->locals; e2 != NULL; e2 = e2->next) for (e2 = t->locals; e2 != NULL; e2 = e2->next)
if (strcmp (e1->match, e2->match) == 0) if (strcmp (e1->match, e2->match) == 0)
einfo ("%X%P: duplicate expression `%s' in version information\n", einfo ("%X%P: duplicate expression `%s' in version information\n",
@ -3943,11 +3960,6 @@ lang_register_vers_node (name, version, deps)
if (strcmp (e1->match, e2->match) == 0) if (strcmp (e1->match, e2->match) == 0)
einfo ("%X%P: duplicate expression `%s' in version information\n", einfo ("%X%P: duplicate expression `%s' in version information\n",
e1->match); e1->match);
for (e2 = t->locals; e2 != NULL; e2 = e2->next)
if (strcmp (e1->match, e2->match) == 0)
einfo ("%X%P: duplicate expression `%s' in version information\n",
e1->match);
} }
} }