forked from Imagelibrary/binutils-gdb
binutils: properly split ar and ranlib
By not linking the exact same object file twice, in particular ranlib can benefit quite a bit from the compiler eliminating dead code.
This commit is contained in:
@@ -67,7 +67,9 @@ static int mri_mode;
|
||||
/* This flag distinguishes between ar and ranlib:
|
||||
1 means this is 'ranlib'; 0 means this is 'ar'.
|
||||
-1 means if we should use argv[0] to decide. */
|
||||
#ifndef is_ranlib
|
||||
extern int is_ranlib;
|
||||
#endif
|
||||
|
||||
/* Nonzero means don't warn about creating the archive file if necessary. */
|
||||
int silent_create = 0;
|
||||
@@ -735,6 +737,7 @@ main (int argc, char **argv)
|
||||
|
||||
expandargv (&argc, &argv);
|
||||
|
||||
#ifndef is_ranlib
|
||||
if (is_ranlib < 0)
|
||||
{
|
||||
const char *temp = lbasename (program_name);
|
||||
@@ -745,6 +748,7 @@ main (int argc, char **argv)
|
||||
else
|
||||
is_ranlib = 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (bfd_init () != BFD_INIT_MAGIC)
|
||||
fatal (_("fatal error: libbfd ABI mismatch"));
|
||||
|
||||
Reference in New Issue
Block a user