Implement new command line option for new ABI: -p which prevents the ARM code
authorNick Clifton <nickc@redhat.com>
Sat, 29 May 1999 10:57:44 +0000 (10:57 +0000)
committerNick Clifton <nickc@redhat.com>
Sat, 29 May 1999 10:57:44 +0000 (10:57 +0000)
from exhibiting any knowledge of the length of the processor's pipeline.

ld/ChangeLog
ld/emultempl/armelf.em
ld/emultempl/armelf_oabi.em

index 1a4373a37cffa5f73ec016103b33d8169cbc3563..546d82fdf080c40089fd336872d3984327bed2dc 100644 (file)
@@ -1,3 +1,16 @@
+1999-05-29  Nick Clifton  <nickc@cygnus.com>
+
+       * emultempl/armelf.em (..._parse_args): New function: Parse
+       command line option.  Accept arm-elf specific command line option
+       '-p' or '--no-pipeline-knowledge'.
+       (..._list_options): New function: Describe the new command line
+       option.
+       (..._before_allocation): Pass the value of the new variable
+       no_pipeline_knowledge to bfd_elf32_arm_process_before_allocation.
+       
+       * emultemp/armelf_oabi.em (..._before_allocation): Pass zero as
+       the third parameter to bfd_elf32_arm_process_before_allocation.
+
 1999-05-28  Nick Clifton  <nickc@cygnus.com>
 
        * lexsup.c (help): Minor formatting changes.
index 03f7acad2546a8d006241bad2e84610ae60264f3..6512ee38c41234b487cf6cac86d01841297797bf 100644 (file)
@@ -63,6 +63,62 @@ static void gld${EMULATION_NAME}_place_section
 static void gld${EMULATION_NAME}_before_parse PARAMS ((void));
 static void gld${EMULATION_NAME}_before_allocation PARAMS ((void));
 static char *gld${EMULATION_NAME}_get_script PARAMS ((int *isfile));
+static int  gld${EMULATION_NAME}_parse_args PARAMS((int, char **));
+static void gld${EMULATION_NAME}_list_options PARAMS ((FILE *));
+
+\f
+static int no_pipeline_knowledge = 0;
+
+static struct option longopts[] =
+{
+  { "no-pipeline-knowledge", no_argument, NULL, 'p'},
+  { NULL, no_argument, NULL, 0 }
+};
+
+static void
+gld${EMULATION_NAME}_list_options (file)
+     FILE * file;
+{
+  fprintf (file, _("  -p --no-pipeline-knowledge  Stop the linker knowing about the pipeline length\n"));
+}
+
+static int
+gld${EMULATION_NAME}_parse_args (argc, argv)
+     int     argc;
+     char ** argv;
+{
+  int        longind;
+  int        optc;
+  int        prevoptind = optind;
+  int        prevopterr = opterr;
+  int        wanterror;
+  static int lastoptind = -1;
+
+  if (lastoptind != optind)
+    opterr = 0;
+  
+  wanterror  = opterr;
+  lastoptind = optind;
+
+  optc   = getopt_long_only (argc, argv, "-p", longopts, & longind);
+  opterr = prevopterr;
+
+  switch (optc)
+    {
+    default:
+      if (wanterror)
+       xexit (1);
+      optind =  prevoptind;
+      return 0;
+
+    case 'p':
+      no_pipeline_knowledge = 1;
+      break;
+    }
+  
+  return 1;
+}
+\f
 
 static void
 gld${EMULATION_NAME}_before_parse ()
@@ -1061,7 +1117,8 @@ gld${EMULATION_NAME}_before_allocation ()
   {
     LANG_FOR_EACH_INPUT_STATEMENT (is)
       {
-       if (!bfd_elf32_arm_process_before_allocation (is->the_bfd, &link_info))
+       if (!bfd_elf32_arm_process_before_allocation (is->the_bfd, & link_info,
+                                                     no_pipeline_knowledge))
          {
            /* xgettext:c-format */
            einfo (_("Errors encountered processing file %s"), is->filename);
@@ -1146,8 +1203,9 @@ struct ld_emulation_xfer_struct ld_${EMULATION_NAME}_emulation =
   gld${EMULATION_NAME}_open_dynamic_archive,
   gld${EMULATION_NAME}_place_orphan,
   NULL, /* set_symbols */
-  NULL,
+  gld${EMULATION_NAME}_parse_args,
   NULL, /* unrecognised file */
-  NULL
+  gld${EMULATION_NAME}_list_options,
+  NULL /* recognized file */
 };
 EOF
index c0526e5d6f7410413d371f4bb689ddcecb768a72..20a50dfe652a8a5ef22dc48174f689242cb3cff1 100644 (file)
@@ -71,7 +71,7 @@ gld${EMULATION_NAME}_before_allocation ()
   {
     LANG_FOR_EACH_INPUT_STATEMENT (is)
       {
-       if (!bfd_elf32_arm_process_before_allocation (is->the_bfd, &link_info))
+       if (!bfd_elf32_arm_process_before_allocation (is->the_bfd, &link_info, 0))
          {
            /* xgettext:c-format */
            einfo (_("Errors encountered processing file %s"), is->filename);
This page took 0.046987 seconds and 4 git commands to generate.