*** empty log message ***
[deliverable/binutils-gdb.git] / binutils / dlltool.c
index ffcb6ed60896c4552779c356a5f8841c3e09a158..d8bb03c0a8b8c193296395f8e3bc404e30e0468c 100644 (file)
@@ -16,8 +16,8 @@
 
    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
-   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-   02111-1307, USA.  */
+   Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
+   02110-1301, USA.  */
 
 
 /* This program allows you to build the files necessary to create
 
 #include <time.h>
 #include <sys/stat.h>
-
-#ifdef ANSI_PROTOTYPES
 #include <stdarg.h>
-#else
-#include <varargs.h>
-#endif
-
 #include <assert.h>
 
 #ifdef DLLTOOL_ARM
@@ -705,10 +699,9 @@ static int nfunc (const void *, const void *);
 static void remove_null_names (export_type **);
 static void process_duplicates (export_type **);
 static void fill_ordinals (export_type **);
-static int alphafunc (const void *, const void *);
 static void mangle_defs (void);
 static void usage (FILE *, int);
-static void inform (const char *, ...);
+static void inform (const char *, ...) ATTRIBUTE_PRINTF_1;
 static void set_dll_name_from_def (const char *);
 
 static char *
@@ -2834,8 +2827,16 @@ nfunc (const void *a, const void *b)
 {
   export_type *ap = *(export_type **) a;
   export_type *bp = *(export_type **) b;
+  const char *an = ap->name;
+  const char *bn = bp->name;
+
+  if (killat)
+    {
+      an = (an[0] == '@') ? an + 1 : an;
+      bn = (bn[0] == '@') ? bn + 1 : bn;
+    }
 
-  return (strcmp (ap->name, bp->name));
+  return (strcmp (an, bn));
 }
 
 static void
@@ -2979,15 +2980,6 @@ fill_ordinals (export_type **d_export_vec)
     }
 }
 
-static int
-alphafunc (const void *av, const void *bv)
-{
-  const export_type **a = (const export_type **) av;
-  const export_type **b = (const export_type **) bv;
-
-  return strcmp ((*a)->name, (*b)->name);
-}
-
 static void
 mangle_defs (void)
 {
@@ -3023,7 +3015,7 @@ mangle_defs (void)
 
   d_exports_lexically[i] = 0;
 
-  qsort (d_exports_lexically, i, sizeof (export_type *), alphafunc);
+  qsort (d_exports_lexically, i, sizeof (export_type *), nfunc);
 
   /* Fill exp entries with their hint values.  */
   for (i = 0; i < d_nfuncs; i++)
@@ -3066,6 +3058,7 @@ usage (FILE *file, int status)
   fprintf (file, _("   -v --verbose              Be verbose.\n"));
   fprintf (file, _("   -V --version              Display the program version.\n"));
   fprintf (file, _("   -h --help                 Display this information.\n"));
+  fprintf (file, _("   @<file>                   Read options from <file>.\n"));
 #ifdef DLLTOOL_MCORE_ELF
   fprintf (file, _("   -M --mcore-elf <outname>  Process mcore-elf object files into <outname>.\n"));
   fprintf (file, _("   -L --linker <name>        Use <name> as the linker.\n"));
@@ -3132,6 +3125,8 @@ main (int ac, char **av)
   bindtextdomain (PACKAGE, LOCALEDIR);
   textdomain (PACKAGE);
 
+  expandargv (&ac, &av);
+
   while ((c = getopt_long (ac, av,
 #ifdef DLLTOOL_MCORE_ELF
                           "m:e:l:aD:d:z:b:xp:cCuUkAS:f:nvVHhM:L:F:",
This page took 0.027595 seconds and 4 git commands to generate.