Skip to content

Commit 885d864

Browse files
committed
section-select: Fix exclude-file-3
this testcase wasn't correctly testing everything, it passed, even though sections from an excluded file were included. Fixing this reveals a problem in the new section selector. This fixes that as well.
1 parent d779149 commit 885d864

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

ld/ldlang.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -422,6 +422,10 @@ walk_wild_section_match (lang_wild_statement_type *ptr,
422422
return;
423423
}
424424

425+
/* If filename is excluded we're done. */
426+
if (walk_wild_file_in_exclude_list (ptr->exclude_name_list, file))
427+
return;
428+
425429
/* Check section name against each wildcard spec. If there's no
426430
wildcard all sections match. */
427431
sec = ptr->section_list;
@@ -920,9 +924,6 @@ resolve_wilds (void)
920924
LANG_FOR_EACH_INPUT_STATEMENT (f)
921925
{
922926
//printf("XXX %s\n", f->filename);
923-
/* XXX if (walk_wild_file_in_exclude_list (s->exclude_name_list, f))
924-
return;*/
925-
926927
if (f->the_bfd == NULL
927928
|| !bfd_check_format (f->the_bfd, bfd_archive))
928929
resolve_wild_sections (f);

ld/testsuite/ld-scripts/exclude-file-3.map

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,7 @@
33
EXCLUDE_FILE\(\*-b\.o\) \*\(\.data \.data\.\*\)
44
\.data +0x[0-9a-f]+ +0x[0-9a-f]+ tmpdir/exclude-file-a\.o
55
\.data\.1 +0x[0-9a-f]+ +0x[0-9a-f]+ tmpdir/exclude-file-a\.o
6+
#failif
7+
.*data +0x[0-9a-f]+ +0x[0-9a-f]+ .*exclude-file-b.*
68

7-
#...
9+
#...

0 commit comments

Comments
 (0)