group sections.
(output_section_callback): Adjust.
* ldlang.h (unique_section_p): Update prototype.
* emultempl/elf32.em (gld${EMULATION_NAME}_place_orphan): Adjust.
+2004-04-30 Alan Modra <amodra@bigpond.net.au>
+
+ * ldlang.c (unique_section_p): Pass section parm, return true on
+ group sections.
+ (output_section_callback): Adjust.
+ * ldlang.h (unique_section_p): Update prototype.
+ * emultempl/elf32.em (gld${EMULATION_NAME}_place_orphan): Adjust.
+
2004-04-30 Eric Botcazou <ebotcazou@act-europe.fr>
* ld.texinfo (--gc-sections): Remove restriction for
isdyn = 1;
}
- if (isdyn || (!config.unique_orphan_sections && !unique_section_p (secname)))
+ if (isdyn || (!config.unique_orphan_sections && !unique_section_p (s)))
{
/* Look through the script to see where to place this section. */
os = lang_output_section_find (secname);
}
bfd_boolean
-unique_section_p (const char *secnam)
+unique_section_p (const asection *sec)
{
struct unique_sections *unam;
+ const char *secnam;
+ if (link_info.relocatable
+ && sec->owner != NULL
+ && bfd_is_group_section (sec->owner, sec))
+ return TRUE;
+
+ secnam = sec->name;
for (unam = unique_section_list; unam; unam = unam->next)
if (wildcardp (unam->name)
? fnmatch (unam->name, secnam, 0) == 0
lang_statement_union_type *before;
/* Exclude sections that match UNIQUE_SECTION_LIST. */
- if (unique_section_p (bfd_get_section_name (file->the_bfd, section)))
+ if (unique_section_p (section))
return;
/* If the wild pattern was marked KEEP, the member sections
extern void lang_register_vers_node
(const char *, struct bfd_elf_version_tree *, struct bfd_elf_version_deps *);
bfd_boolean unique_section_p
- (const char *);
+ (const asection *);
extern void lang_add_unique
(const char *);
extern const char *lang_get_output_target