Changeset 86


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
Files:
8 added
37 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/binutils/bfd/acinclude.m4

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.2
    r85 r86  
    44case "${host}" in
    55changequote(,)dnl
    6 *-*-msdos* | *-*-go32* | *-*-mingw32* | *-*-cygwin* | *-*-windows*)
     6*-*-msdos* | *-*-go32* | *-*-mingw32* | *-*-cygwin* | *-*-windows* | *-*-os2*)
    77changequote([,])dnl
    88  AC_DEFINE(USE_BINARY_FOPEN, 1, [Use b modifier when opening binary files?]) ;;
  • trunk/src/binutils/bfd/aoutx.h

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.2
    r85 r86  
    270270
    271271#define TABLE_SIZE(TABLE)       (sizeof (TABLE)/sizeof (TABLE[0]))
     272
     273#ifndef IS_STAB
     274#  define IS_STAB(flags) ((flags) & N_STAB)
     275#endif
    272276
    273277reloc_howto_type *
     
    13761380  flagword visible;
    13771381
    1378   if ((cache_ptr->type & N_STAB) != 0
     1382  if (IS_STAB(cache_ptr->type)
    13791383      || cache_ptr->type == N_FN)
    13801384    {
     
    16151619      cache_ptr->symbol.flags = BSF_WEAK;
    16161620      break;
     1621
     1622#ifdef EMX
     1623    case N_IMP1 | N_EXT:
     1624      cache_ptr->symbol.section = bfd_abs_section_ptr;
     1625      cache_ptr->symbol.flags = BSF_EMX_IMPORT1;
     1626      break;
     1627
     1628    case N_IMP2 | N_EXT:
     1629      cache_ptr->symbol.section = bfd_abs_section_ptr;
     1630      cache_ptr->symbol.flags = BSF_EMX_IMPORT2;
     1631      break;
     1632#endif /* EMX */
    16171633    }
    16181634
     
    31493165         below.  */
    31503166      if (((type & N_EXT) == 0
    3151            || (type & N_STAB) != 0
     3167           || IS_STAB(type)
    31523168           || type == N_FN)
    31533169          && type != N_WEAKA
     
    31803196          || type == (N_BSS | N_EXT)
    31813197          || type == (N_ABS | N_EXT)
    3182           || type == (N_INDR | N_EXT))
     3198          || type == (N_INDR | N_EXT)
     3199#if defined (EMX)
     3200          || type == (N_IMP1 | N_EXT)
     3201#endif
     3202         )
    31833203        {
    31843204          /* This object file defines this symbol.  We must link it
     
    33533373
    33543374      /* Ignore debugging symbols.  */
    3355       if ((type & N_STAB) != 0)
     3375      if (IS_STAB(type))
    33563376        continue;
    33573377
     
    34733493          flags = BSF_WEAK;
    34743494          break;
     3495#ifdef EMX
     3496        case N_IMP1 | N_EXT:
     3497          section = bfd_abs_section_ptr;
     3498          flags = BSF_EMX_IMPORT1;
     3499          value = -1; /* -1 in *ABS* means external imported symbol */
     3500          break;
     3501        case N_IMP2 | N_EXT:
     3502          section = bfd_abs_section_ptr;
     3503          flags = BSF_EMX_IMPORT2;
     3504          break;
     3505#endif /* EMX */
    34753506        }
    34763507
     
    41894220              break;
    41904221            case strip_debugger:
    4191               if ((type & N_STAB) != 0)
     4222              if (IS_STAB(type))
    41924223                skip = true;
    41934224              break;
     
    42374268              symsec = NULL;
    42384269            }
    4239           else if ((type & N_STAB) != 0)
     4270          else if ((type == (N_IMP1 | N_EXT))
     4271                || (type == (N_IMP2 | N_EXT)))
     4272            symsec = bfd_abs_section_ptr;
     4273          else if (IS_STAB(type))
    42404274            {
    42414275              val = GET_WORD (input_bfd, sym->e_value);
     
    43544388                  break;
    43554389                case discard_l:
    4356                   if ((type & N_STAB) == 0
     4390                  if (!IS_STAB(type)
    43574391                      && bfd_is_local_label_name (input_bfd, name))
    43584392                    skip = true;
     
    48644898              h = sym_hashes[r_index];
    48654899              if (h != (struct aout_link_hash_entry *) NULL
     4900#ifdef EMX
     4901              /* Don't touch imported symbols */
     4902                  && (!bfd_is_abs_section (h->root.u.def.section)
     4903                      || (h->root.u.def.value != -1))
     4904#endif
    48664905                  && (h->root.type == bfd_link_hash_defined
    48674906                      || h->root.type == bfd_link_hash_defweak))
  • trunk/src/binutils/bfd/archive.c

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.2
    r85 r86  
    19141914                       flags & BSF_WEAK ||
    19151915                       flags & BSF_INDIRECT ||
     1916#ifdef EMX
     1917                       flags & BSF_EMX_IMPORT1 ||
     1918#endif /* EMX */
    19161919                       bfd_is_com_section (sec))
    19171920                      && ! bfd_is_und_section (sec))
  • trunk/src/binutils/bfd/bfd-in2.h

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.2
    r85 r86  
    28032803#define BSF_DEBUGGING_RELOC 0x20000
    28042804
     2805         /* Symbol is an emx import reference.  */
     2806#define BSF_EMX_IMPORT1   0x20000000
     2807
     2808         /* Symbol is an emx import definition.  */
     2809#define BSF_EMX_IMPORT2   0x40000000
     2810
    28052811  flagword flags;
    28062812
  • trunk/src/binutils/bfd/config.bfd

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.2
    r85 r86  
    915915    targ_selvecs=ieee_vec
    916916    ;;
     917
     918  i[3456]86-*-os2*)
     919    targ_defvec=i386aout_emx_vec
     920    targ_selvecs=i386aout_emx_vec
     921    targ_underscore=yes
     922    ;;
     923
    917924# END OF targmatch.h
    918925  *)
  • trunk/src/binutils/bfd/configure.in

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.2
    r85 r86  
    219219  i[3456]86-*-isc*)     COREFILE=trad-core.lo ;;
    220220  i[3456]86-*-aix*)     COREFILE=aix386-core.lo ;;
    221 changequote([,])dnl
     221  i[3456]86-*-os2*)
     222changequote([,])dnl
     223        COREFILE=trad-core.lo
     224        AC_DEFINE(TRAD_HEADER,"hosts/i386emx.h")
     225        ;;
    222226  i860-*-mach3* | i860-*-osf1*)
    223227        COREFILE=trad-core.lo
     
    589593    i386netbsd_vec)             tb="$tb i386netbsd.lo aout32.lo" ;;
    590594    i386os9k_vec)               tb="$tb i386os9k.lo aout32.lo" ;;
     595    i386aout_emx_vec)           tb="$tb i386aoutemx.lo aout32.lo " ;;
    591596    i860coff_vec)               tb="$tb coff-i860.lo cofflink.lo" ;;
    592597    icoff_big_vec)              tb="$tb coff-i960.lo cofflink.lo" ;;
  • trunk/src/binutils/bfd/host-aout.c

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.2
    r85 r86  
    3636
    3737   in the ./hosts/h-systemname.h file.  */
    38 
    39 #ifdef TRAD_HEADER
    40 #include TRAD_HEADER
    41 #endif
    4238
    4339#ifdef                  HOST_PAGE_SIZE
  • trunk/src/binutils/bfd/libaout.h

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.2
    r85 r86  
    186186{
    187187    long a_info;                /* Magic number and flags, packed */
     188#if defined (__EMX__)
     189    long emx_add;
     190#endif
    188191    bfd_vma a_text;             /* length of text, in bytes  */
    189192    bfd_vma a_data;             /* length of data, in bytes  */
  • trunk/src/binutils/bfd/syms.c

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.2
    r85 r86  
    289289.#define BSF_DEBUGGING_RELOC 0x20000
    290290.
     291.       {* Symbol is an emx import reference.  *}
     292.#define BSF_EMX_IMPORT1   0x20000000
     293.
     294.       {* Symbol is an emx import definition.  *}
     295.#define BSF_EMX_IMPORT2   0x40000000
     296.
    291297.  flagword flags;
    292298.
     
    459465            ? (type & BSF_GLOBAL) ? '!' : 'l'
    460466            : (type & BSF_GLOBAL) ? 'g' : ' '),
     467#ifdef EMX
     468           (type & BSF_EMX_IMPORT1) ? 'e' :
     469           (type & BSF_EMX_IMPORT2) ? 'E' :
     470#endif /* EMX */
    461471           (type & BSF_WEAK) ? 'w' : ' ',
    462472           (type & BSF_CONSTRUCTOR) ? 'C' : ' ',
     
    602612        return 'W';
    603613    }
     614#ifdef EMX
     615  if (symbol->flags & BSF_EMX_IMPORT1)
     616    return 'e';
     617  if (symbol->flags & BSF_EMX_IMPORT2)
     618    return 'E';
     619#endif /* EMX */
    604620  if (!(symbol->flags & (BSF_GLOBAL | BSF_LOCAL)))
    605621    return '?';
  • trunk/src/binutils/bfd/sysdep.h

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.2
    r85 r86  
    2626
    2727#include "config.h"
     28
     29#ifdef TRAD_HEADER
     30#include TRAD_HEADER
     31#endif
    2832
    2933#ifdef HAVE_STDDEF_H
  • trunk/src/binutils/bfd/targets.c

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.2
    r85 r86  
    586586extern const bfd_target i386bsd_vec;
    587587extern const bfd_target i386coff_vec;
     588extern const bfd_target i386aout_emx_vec;
    588589extern const bfd_target i386dynix_vec;
    589590extern const bfd_target i386freebsd_vec;
  • trunk/src/binutils/bfd/trad-core.c

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.2
    r85 r86  
    4444#include <sys/user.h>           /* After a.out.h  */
    4545
    46 #ifdef TRAD_HEADER
    47 #include TRAD_HEADER
    48 #endif
    49 
    5046  struct trad_core_struct
    5147    {
    5248      asection *data_section;
     49#ifdef __EMX__
     50      asection *heap_section;
     51#endif /* __EMX__ */
    5352      asection *stack_section;
    5453      asection *reg_section;
     
    5857#define core_upage(bfd) (&((bfd)->tdata.trad_core_data->u))
    5958#define core_datasec(bfd) ((bfd)->tdata.trad_core_data->data_section)
     59#ifdef __EMX__
     60#define core_heapsec(bfd) ((bfd)->tdata.trad_core_data->heap_section)
     61#endif /* __EMX__ */
    6062#define core_stacksec(bfd) ((bfd)->tdata.trad_core_data->stack_section)
    6163#define core_regsec(bfd) ((bfd)->tdata.trad_core_data->reg_section)
     
    9799
    98100  /* Sanity check perhaps??? */
     101#ifdef __EMX__
     102  if (u.u_magic != UMAGIC)
     103    return 0;
     104#else /* !__EMX__ */
    99105  if (u.u_dsize > 0x1000000)    /* Remember, it's in pages...  */
    100106    {
     
    145151#endif
    146152  }
     153#endif /* !__EMX__ */
    147154
    148155  /* OK, we believe you.  You're a core file (sure, sure).  */
     
    171178  if (core_regsec (abfd) == NULL)
    172179    return NULL;
     180#ifdef EMX
     181  core_heapsec (abfd) = (asection *) bfd_zmalloc (sizeof (asection));
     182  if (core_heapsec (abfd) == NULL)
     183    return NULL;
     184#endif /* EMX */
    173185
    174186  core_stacksec (abfd)->name = ".stack";
    175187  core_datasec (abfd)->name = ".data";
     188#ifdef EMX
     189  core_heapsec (abfd)->name = ".heap";
     190#endif /* EMX */
    176191  core_regsec (abfd)->name = ".reg";
    177192
     
    179194  core_datasec (abfd)->flags = SEC_ALLOC + SEC_LOAD + SEC_HAS_CONTENTS;
    180195  core_regsec (abfd)->flags = SEC_HAS_CONTENTS;
    181 
     196#ifdef EMX
     197  core_heapsec (abfd)->flags = SEC_ALLOC + SEC_LOAD + SEC_HAS_CONTENTS;
     198#endif /* EMX */
     199
     200#ifdef EMX
     201  core_datasec (abfd)->_raw_size =  u.u_data_end - u.u_data_base;
     202  core_heapsec (abfd)->_raw_size = u.u_heap_brk - u.u_heap_base;
     203  core_stacksec (abfd)->_raw_size = u.u_stack_end - u.u_stack_low;
     204  core_regsec (abfd)->_raw_size = sizeof (struct user);
     205#else /* not EMX */
    182206  core_datasec (abfd)->_raw_size =  NBPG * u.u_dsize
    183207#ifdef TRAD_CORE_DSIZE_INCLUDES_TSIZE
     
    187211  core_stacksec (abfd)->_raw_size = NBPG * u.u_ssize;
    188212  core_regsec (abfd)->_raw_size = NBPG * UPAGES; /* Larger than sizeof struct u */
     213#endif /* not EMX */
    189214
    190215  /* What a hack... we'd like to steal it from the exec file,
    191216     since the upage does not seem to provide it.  FIXME.  */
     217#ifdef EMX
     218  core_datasec (abfd)->vma = u.u_data_base;
     219  core_heapsec (abfd)->vma = u.u_heap_base;
     220  core_stacksec (abfd)->vma = u.u_stack_low;
     221#else /* not EMX */
    192222#ifdef HOST_DATA_START_ADDR
    193223  core_datasec (abfd)->vma = HOST_DATA_START_ADDR;
     
    201231  core_stacksec (abfd)->vma = HOST_STACK_END_ADDR - (NBPG * u.u_ssize);
    202232#endif
     233#endif /* not EMX */
    203234
    204235  /* This is tricky.  As the "register section", we give them the entire
     
    218249  core_regsec (abfd)->vma = - (bfd_vma) u.u_ar0;
    219250
     251#ifdef EMX
     252  core_datasec (abfd)->filepos = u.u_data_off;
     253  core_heapsec (abfd)->filepos = u.u_heap_off;
     254  core_stacksec (abfd)->filepos = u.u_stack_off;
     255#else /* not EMX */
    220256  core_datasec (abfd)->filepos = NBPG * UPAGES;
    221257  core_stacksec (abfd)->filepos = (NBPG * UPAGES) + NBPG * u.u_dsize
     
    224260#endif
    225261      ;
     262#endif /* not EMX */
     263
    226264  core_regsec (abfd)->filepos = 0; /* Register segment is the upage */
    227265
     
    229267  core_stacksec (abfd)->alignment_power = 2;
    230268  core_datasec (abfd)->alignment_power = 2;
     269#ifdef EMX
     270  core_heapsec (abfd)->alignment_power = 2;
     271#endif /* EMX */
    231272  core_regsec (abfd)->alignment_power = 2;
    232273
    233274  abfd->sections = core_stacksec (abfd);
    234275  core_stacksec (abfd)->next = core_datasec (abfd);
     276#ifdef EMX
     277  core_datasec (abfd)->next = core_heapsec (abfd);
     278  core_heapsec (abfd)->next = core_regsec (abfd);
     279  abfd->section_count = 4;
     280#else /* not EMX */
    235281  core_datasec (abfd)->next = core_regsec (abfd);
    236282  abfd->section_count = 3;
     283#endif /* not EMX */
    237284
    238285  return abfd->xvec;
  • trunk/src/binutils/binutils/addr2line.c

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.2
    r85 r86  
    211211          if (base_names && filename != NULL)
    212212            {
     213#if !defined (__EMX__)
    213214              char *h;
    214215
     
    216217              if (h != NULL)
    217218                filename = h + 1;
     219#else
     220              filename = _getname (filename);
     221#endif
    218222            }
    219223
     
    286290  textdomain (PACKAGE);
    287291
     292#if defined (__EMX__)
     293  program_name = _getname(*argv);
     294#else
    288295  program_name = *argv;
     296#endif /* __EMX__ */
    289297  xmalloc_set_program_name (program_name);
    290298
  • trunk/src/binutils/binutils/ar.c

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.2
    r85 r86  
    385385  textdomain (PACKAGE);
    386386
     387#if defined (__EMX__)
     388  _wildcard (&argc, &argv);
     389  _response (&argc, &argv);
     390  program_name = _getname(argv[0]);
     391#else
    387392  program_name = argv[0];
     393#endif /* __EMX__ */
    388394  xmalloc_set_program_name (program_name);
    389395
     
    573579          full_pathname = true;
    574580          break;
     581#ifdef __EMX__
     582        case 'J':
     583          /* Silently ignore `J' for backward compatibility. */
     584          break;
     585#endif /* __EMX__ */
    575586        default:
    576587          /* xgettext:c-format */
  • trunk/src/binutils/binutils/bucomm.c

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.2
    r85 r86  
    217217  static char template[] = "stXXXXXX";
    218218  char *tmpname;
     219#if defined (__EMX__)
     220  char *slash = _getname (filename);
     221  if (slash == filename)
     222    slash = NULL;
     223  else
     224    slash -= 1;
     225#else /* not __EMX__ */
    219226  char *slash = strrchr (filename, '/');
     227#endif /* not __EMX__ */
    220228
    221229#ifdef HAVE_DOS_BASED_FILE_SYSTEM
  • trunk/src/binutils/binutils/nm.c

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.2
    r85 r86  
    406406  textdomain (PACKAGE);
    407407
     408#if defined (__EMX__)
     409  _wildcard (&argc, &argv);
     410  _response (&argc, &argv);
     411  program_name = _getname(*argv);
     412#else
    408413  program_name = *argv;
     414#endif /* __EMX__ */
    409415  xmalloc_set_program_name (program_name);
    410416
  • trunk/src/binutils/binutils/objdump.c

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.2
    r85 r86  
    28262826  textdomain (PACKAGE);
    28272827
     2828#if defined (__EMX__)
     2829  _wildcard (&argc, &argv);
     2830  _response (&argc, &argv);
     2831  program_name = _getname(*argv);
     2832#else
    28282833  program_name = *argv;
     2834#endif /* __EMX__ */
    28292835  xmalloc_set_program_name (program_name);
    28302836
  • trunk/src/binutils/binutils/rename.c

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.2
    r85 r86  
    156156  exists = lstat (to, &s) == 0;
    157157
    158 #if defined (_WIN32) && !defined (__CYGWIN32__)
     158#if (defined (_WIN32) && !defined (__CYGWIN32__)) || defined (__OS2__)
    159159  /* Win32, unlike unix, will not erase `to' in `rename(from, to)' but
    160160     fail instead.  Also, chown is not present.  */
  • trunk/src/binutils/binutils/size.c

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.2
    r85 r86  
    119119  textdomain (PACKAGE);
    120120
     121#if defined (__EMX__)
     122  _wildcard (&argc, &argv);
     123  _response (&argc, &argv);
     124  program_name = _getname(*argv);
     125#else
    121126  program_name = *argv;
     127#endif /* __EMX__ */
    122128  xmalloc_set_program_name (program_name);
    123129
  • trunk/src/binutils/binutils/strings.c

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.2
    r85 r86  
    152152  textdomain (PACKAGE);
    153153
     154#if defined (__EMX__)
     155  program_name = _getname(argv[0]);
     156#else
    154157  program_name = argv[0];
     158#endif /* __EMX__ */
    155159  xmalloc_set_program_name (program_name);
    156160  string_min = -1;
  • trunk/src/binutils/configure.in

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.2
    r85 r86  
    217217  *-windows*)
    218218    host_makefile_frag="${host_makefile_frag} config/mh-windows"
     219    ;;
     220  i[3456]86-*-os2*)
     221    host_makefile_frag="${host_makefile_frag} config/mh-emx"
    219222    ;;
    220223  vax-*-ultrix2*)
  • 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
  • trunk/src/binutils/gprof/gmon.h

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.2
    r85 r86  
    7070/*
    7171 * Histogram counters are unsigned shorts:
     72 * For emx, histogram counters are unsigned longs.
    7273 */
     74#ifdef EMX
     75#define HISTCOUNTER unsigned long
     76#else
    7377#define HISTCOUNTER unsigned short
     78#endif
    7479
    7580/*
  • trunk/src/binutils/gprof/hertz.h

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.2
    r85 r86  
    33
    44#include "gprof.h"
     5
     6#ifdef __EMX__
     7#define HERTZ (_osmode == OS2_MODE ? 1000 : 1024)
     8#endif
    59
    610#define HZ_WRONG 0              /* impossible clock frequency */
  • trunk/src/binutils/include/aout/aout64.h

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.2
    r85 r86  
    323323#define N_WEAKD 0x10            /* Weak data symbol.  */
    324324#define N_WEAKB 0x11            /* Weak bss symbol.  */
     325
     326/* emx-specific symbols.  */
     327#define N_IMP1 0x68             /* Import reference (emx specific) */
     328#define N_IMP2 0x6a             /* Import definition (emx specific) */
    325329
    326330/* Relocations
  • trunk/src/binutils/ld/Makefile.in

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.2
    r85 r86  
    13171317  $(srcdir)/emultempl/pe.em $(srcdir)/scripttempl/pe.sc ${GEN_DEPENDS}
    13181318        ${GENSCRIPTS} i386pe_posix "$(tdir_i386pe_posix)"
     1319ei386aoutemx.c: $(srcdir)/emulparams/i386aout.sh \
     1320  $(srcdir)/emultempl/i386aoutemx.em $(srcdir)/scripttempl/i386aoutemx.sc ${GEN_DEPENDS}
     1321        ${GENSCRIPTS} i386aoutemx "$(tdir_i386aoutemx)"
    13191322elnk960.c: $(srcdir)/emulparams/lnk960.sh \
    13201323  $(srcdir)/emultempl/lnk960.em $(srcdir)/scripttempl/i960.sc ${GEN_DEPENDS}
  • trunk/src/binutils/ld/configure.host

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.2
    r85 r86  
    223223  ;;
    224224
     225*-*-os2*)
     226  HLDFLAGS="-s -Zexe -Zcrtdll"
     227  NATIVE_LIB_DIRS=/emx/lib
    225228esac
  • trunk/src/binutils/ld/configure.tgt

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.2
    r85 r86  
    171171i[3456]86-*-interix*)   targ_emul=i386pe_posix;
    172172                        targ_extra_ofiles="deffilep.o pe-dll.o" ;;
     173i[3456]86-*-os2)        targ_emul=i386aoutemx; tdir_i386emx=i386aoutemx ;;
    173174i[3456]86-*-beospe*)    targ_emul=i386beos ;;
    174175i[3456]86-*-beos*)      targ_emul=elf_i386_be ;;
  • trunk/src/binutils/ld/ldctor.c

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.2
    r85 r86  
    363363              if (e->name != NULL)
    364364                minfo ("%T\n", e->name);
    365               else
     365              else if (e->section->owner)
    366366                minfo ("%G\n", e->section->owner, e->section, e->value);
     367              else
     368                minfo ("*unknown*\n");
    367369            }
    368370
  • trunk/src/binutils/ld/ldemul.c

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.2
    r85 r86  
    304304  return 0;
    305305}
     306
     307void
     308ldemul_finish_link (char *filename)
     309{
     310 if (ld_emulation->finish_link)
     311  ld_emulation->finish_link (filename);
     312}
  • trunk/src/binutils/ld/ldemul.h

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.2
    r85 r86  
    140140    PARAMS ((char *, struct lang_input_statement_struct *));
    141141
     142  /* Perform final action(s) on output file */
     143  void (*finish_link) PARAMS ((char *));
     144
    142145} ld_emulation_xfer_type;
    143146
  • trunk/src/binutils/ld/ldfile.c

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.2
    r85 r86  
    240240           arch = arch->next)
    241241        {
     242#if defined (__EMX__)
     243          found = ldfile_open_file_search (arch->name, entry, "", ".a");
     244          if (found)
     245            break;
     246#endif /* __EMX__ */
    242247          found = ldfile_open_file_search (arch->name, entry, "lib", ".a");
    243248          if (found)
  • trunk/src/binutils/ld/ldmain.c

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.2
    r85 r86  
    174174  textdomain (PACKAGE);
    175175
     176#ifdef __EMX__
     177  _response (&argc, &argv);
     178  program_name = _getname(argv[0]);
     179#else
    176180  program_name = argv[0];
     181#endif
    177182  xmalloc_set_program_name (program_name);
    178183
     
    400405      if (! bfd_close (output_bfd))
    401406        einfo (_("%F%B: final close failed: %E\n"), output_bfd);
     407
     408      /* Perform the final actions on output file */
     409      ldemul_finish_link (output_filename);
    402410
    403411      /* If the --force-exe-suffix is enabled, and we're making an
Note: See TracChangeset for help on using the changeset viewer.