Changeset 86 for trunk/src/binutils/gas


Ignore:
Timestamp:
May 3, 2003, 11:45:43 PM (22 years ago)
Author:
bird
Message:

Applied the original 2.11.2 diff.

Location:
trunk/src/binutils/gas
Files:
1 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/binutils/gas/as.c

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.2
    r85 r86  
    110110
    111111static struct itbl_file_list *itbl_files;
     112
     113
     114#ifdef EMX
     115static char *omf_file_name;
     116int emx_omf;                    /* -Zomf */
     117int emx_strip;                  /* -Zstrip */
     118#endif /* EMX */
    112119
    113120
     
    780787  int keep_it;
    781788
     789#ifdef __EMX__
     790  _emxload_env ("GCCLOAD");
     791  _envargs (&argc, &argv, "GASOPT");
     792  _response (&argc, &argv);
     793  _wildcard (&argc, &argv);
     794#endif /* __EMX__ */
     795
    782796  start_time = get_run_time ();
    783797
     
    801815#endif
    802816
     817#ifdef __EMX__
     818  myname = _getname(argv[0]);
     819#else
    803820  myname = argv[0];
     821#endif
    804822  xmalloc_set_program_name (myname);
    805823
     
    827845  subsegs_begin ();
    828846  parse_args (&argc, &argv);
     847
     848#ifdef EMX
     849  if (emx_omf)
     850    {
     851      char *tmp_dir;
     852      size_t tmp_dir_len;
     853
     854      omf_file_name = out_file_name;
     855      tmp_dir = getenv ("TMPDIR");
     856      if (tmp_dir == NULL) tmp_dir = getenv ("TMP");
     857      if (tmp_dir == NULL) tmp_dir = getenv ("TEMP");
     858      if (tmp_dir == NULL) tmp_dir = ".";
     859      tmp_dir_len = strlen (tmp_dir);
     860      out_file_name = xmalloc (tmp_dir_len + 10);
     861      memcpy (out_file_name, tmp_dir, tmp_dir_len);
     862      if (tmp_dir_len != 0 && strchr ("\\/:", tmp_dir[tmp_dir_len-1]) == NULL)
     863        out_file_name[tmp_dir_len++] = '\\';
     864      strcpy (out_file_name + tmp_dir_len, "asXXXXXX");
     865      if (mktemp (out_file_name) == NULL)
     866        as_fatal ("mktemp() failed");
     867    }
     868#endif /* EMX */
     869
    829870  read_begin ();
    830871  input_scrub_begin ();
     
    928969  if (!keep_it)
    929970    unlink (out_file_name);
     971
     972#ifdef EMX
     973  if (keep_it && emx_omf)
     974    {
     975      int rc, i;
     976      char *args[6];
     977
     978      i = 0;
     979      args[i++] = "emxomf";
     980      if (emx_strip)
     981      args[i++] = "-s";
     982      args[i++] = "-o";
     983      args[i++] = omf_file_name;
     984      args[i++] = out_file_name;
     985      args[i] = NULL;
     986      rc = spawnvp (P_WAIT, "emxomf.exe", args);
     987      remove (out_file_name);
     988      if (rc < 0)
     989        as_fatal ("cannot run emxomf");
     990      else if (rc > 0)
     991        as_fatal ("emxomf failed");
     992    }
     993#endif /* EMX */
    930994
    931995  input_scrub_end ();
  • trunk/src/binutils/gas/config/tc-i386.c

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.2
    r85 r86  
    45094509  {"64", no_argument, NULL, OPTION_64},
    45104510#endif
     4511#ifdef EMX
     4512#define OPTION_ZOMF (OPTION_MD_BASE + 1)
     4513  {"Zomf", no_argument, NULL, OPTION_ZOMF},
     4514#define OPTION_ZSTRIP (OPTION_MD_BASE + 2)
     4515  {"Zstrip", no_argument, NULL, OPTION_ZSTRIP},
     4516#endif /* EMX */
    45114517  {NULL, no_argument, NULL, 0}
    45124518};
    45134519size_t md_longopts_size = sizeof (md_longopts);
     4520
     4521#ifdef EMX
     4522extern int emx_omf;
     4523extern int emx_strip;
     4524#endif /* EMX */
    45144525
    45154526int
     
    45654576      default_arch = "i386";
    45664577      break;
     4578
     4579#ifdef EMX
     4580    case OPTION_ZOMF:
     4581      emx_omf = 1;
     4582      break;
     4583
     4584    case OPTION_ZSTRIP:
     4585      emx_strip = 1;
     4586      break;
     4587#endif /* EMX */
    45674588
    45684589    default:
  • trunk/src/binutils/gas/config/tc-i386.h

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.2
    r85 r86  
    9494#ifdef TE_DYNIX
    9595#define AOUT_TARGET_FORMAT      "a.out-i386-dynix"
     96#endif
     97#ifdef TE_EMX
     98#define AOUT_TARGET_FORMAT      "a.out-emx"
    9699#endif
    97100#ifndef AOUT_TARGET_FORMAT
  • trunk/src/binutils/gas/configure.in

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.2
    r85 r86  
    280280      i386-*-mingw32*)      fmt=coff em=pe bfd_gas=yes ;;
    281281      i386-*-*nt*)          fmt=coff em=pe bfd_gas=yes ;;
     282      i386-*-os2*)          fmt=aout em=emx bfd_gas=yes ;;
    282283      i386-*-vxworks*)      fmt=aout ;;
    283284      i386-*-chaos)         fmt=elf ;;
  • trunk/src/binutils/gas/write.c

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.2
    r85 r86  
    857857
    858858#ifdef BFD_ASSEMBLER
     859#ifndef __EMX__
     860/* UGLY HACK: FOR SOME REASON IT DOESN'T WORK WITH EMX,
     861   BUT IT LOOKS LIKE IT IS LIBBFD FAULT! LET'S WAIT TILL IT GETS FIXED. */
    859862        /* We can never adjust a reloc against a weak symbol.  If we
    860863           did, and the weak symbol was overridden by a real symbol
     
    866869            goto done;
    867870          }
     871#endif
    868872#endif
    869873
Note: See TracChangeset for help on using the changeset viewer.