Changeset 86 for trunk/src/binutils/bfd


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/bfd
Files:
2 added
12 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;
Note: See TracChangeset for help on using the changeset viewer.