optimizations for 3x speedup in ld
Nick Clifton
nickc@redhat.com
Fri Feb 18 21:42:00 GMT 2005
Hi Rob,
> I'm attaching the patch so people can see it/test it/comment on it,
> keeping in mind this is copyright Novell for now.
I have had a look over the patch - it certainly does improve the link
times. There were a few small issues with regard to formatting and
comment layout, but nothing serious. So provided that Novell want to
contribute the code we will be very happy to accept it.
Please could you check with Novell management to make sure that it is OK
for you to contribute the patch and if so, please let us know.
Cheers
Nick
PS. I had a thought that might improve the speed of the
walk_wildcard_consider_section() function. What if you removed the
duplicate test of wildcardp (list_tmp->name) ? eg:
static void
walk_wild_consider_section (lang_wild_statement_type *ptr,
lang_input_statement_type *file,
asection *s,
struct wildcard_list *sec,
callback_t callback,
void *data)
{
struct name_list *list_tmp;
/* Don't process sections from files which were excluded. */
for (list_tmp = sec->spec.exclude_name_list;
list_tmp;
list_tmp = list_tmp->next)
{
bfd_boolean skip;
typedef int (*cmp_fn) (const char *, const char *, int);
cmp_fn cmp;
cmp = wildcardp (list_tmp->name) ? fnmatch : (cmp_fn) strcmp;
skip = cmp (list_tmp->name, file->filename, 0) == 0;
/* If this file is part of an archive, and the
archive is excluded, exclude this file. */
if (! skip
&& file->the_bfd != NULL
&& file->the_bfd->my_archive != NULL
&& file->the_bfd->my_archive->filename != NULL)
skip = cmp (list_tmp->name,
file->the_bfd->my_archive->filename, 0) == 0;
if (skip)
return;
}
callback (ptr, sec, s, file, data);
}
More information about the Binutils
mailing list