Changeset 729 for trunk/src/binutils/bfd


Ignore:
Timestamp:
Sep 25, 2003, 9:27:01 PM (22 years ago)
Author:
zap
Message:

.

Location:
trunk/src/binutils/bfd
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/binutils/bfd/aoutx.h

    • Property cvs2svn:cvs-rev changed from 1.4 to 1.5
    r728 r729  
    49954995              /* Don't touch imported symbols */
    49964996                  && (!bfd_is_abs_section (h->root.u.def.section)
    4997                       || (h->root.u.def.value != -1))
     4997                      || (h->root.u.def.value != (unsigned)-1))
    49984998#endif
    49994999                  && (h->root.type == bfd_link_hash_defined
  • trunk/src/binutils/bfd/config.bfd

    • Property cvs2svn:cvs-rev changed from 1.3 to 1.4
    r728 r729  
    543543    targ_selfvecs=i386chaos_vec
    544544    ;;
     545  i[3456]86-*-os2*)
     546    targ_defvec=bfd_elf32_i386_vec
     547    targ_selvecs="bfd_elf32_i386_vec i386aout_emx_vec"
     548    targ_underscore=yes
     549    ;;
    545550
    546551  i860-*-mach3* | i860-*-osf1* | i860-*-coff*)
     
    12491254    ;;
    12501255
    1251   i[3456]86-*-os2*)
    1252     targ_defvec=i386aout_emx_vec
    1253     targ_selvecs=i386aout_emx_vec
    1254     targ_underscore=yes
    1255     ;;
    1256 
    12571256# END OF targmatch.h
    12581257  *)
  • trunk/src/binutils/bfd/configure

    • Property cvs2svn:cvs-rev changed from 1.6 to 1.7
    r728 r729  
    63456345    i386netbsd_vec)             tb="$tb i386netbsd.lo aout32.lo" ;;
    63466346    i386os9k_vec)               tb="$tb i386os9k.lo aout32.lo" ;;
    6347     i386aout_emx_vec)   tb="$tb i386aoutemx.lo aout32.lo" ;;
     6347    i386aout_emx_vec)           tb="$tb i386aoutemx.lo aout32.lo" ;;
    63486348    i386pe_vec)                 tb="$tb pe-i386.lo peigen.lo cofflink.lo" ;;
    63496349    i386pei_vec)                tb="$tb pei-i386.lo peigen.lo cofflink.lo" ;;
  • trunk/src/binutils/bfd/configure.in

    • Property cvs2svn:cvs-rev changed from 1.4 to 1.5
    r728 r729  
    245245changequote([,])dnl
    246246        COREFILE=trad-core.lo
    247         AC_DEFINE(TRAD_HEADER,"hosts/i386emx.h")
     247        TRAD_HEADER='"hosts/i386emx.h"'
    248248        ;;
    249249  i860-*-mach3* | i860-*-osf1*)
     
    709709    i386netbsd_vec)             tb="$tb i386netbsd.lo aout32.lo" ;;
    710710    i386os9k_vec)               tb="$tb i386os9k.lo aout32.lo" ;;
    711     i386aout_emx_vec)   tb="$tb i386aoutemx.lo aout32.lo" ;;
     711    i386aout_emx_vec)           tb="$tb i386aoutemx.lo" ;;
    712712    i386pe_vec)                 tb="$tb pe-i386.lo peigen.lo cofflink.lo" ;;
    713713    i386pei_vec)                tb="$tb pei-i386.lo peigen.lo cofflink.lo" ;;
  • trunk/src/binutils/bfd/host-aout.c

    • Property cvs2svn:cvs-rev changed from 1.4 to 1.5
    r728 r729  
    3838   in the ./hosts/h-systemname.h file.  */
    3939
    40 #ifndef __EMX__ /* r=bird: Code was initially removed. Is this __EMX__ or EMX
    41                  * and why don't we include it? anything to do with sysdep.h? */
    4240#ifdef TRAD_HEADER
    4341#include TRAD_HEADER
    4442#endif
    45 #endif /* !__EMX__ */
    4643
    4744#ifdef                  HOST_PAGE_SIZE
  • trunk/src/binutils/bfd/hosts/i386emx.h

    • Property cvs2svn:cvs-rev changed from 1.2 to 1.3
    r728 r729  
    11/* Intel ix86 running OS/2 or DOS */
    22
    3 #ifndef __I386EMX__H__
    4 #define __I386EMX__H__
    5 
    6 #define EMX
    7 
    8 #define DEFAULT_ARCH            bfd_arch_i386
    9 
    10 #define TARGET_PAGE_SIZE        0x1000
    11 #define TARGET_SEGMENT_SIZE     0x10000
    12 #define TEXT_START_ADDR         0x10000
    13 #define TARGET_STACK_END_ADDR   0x80000000
    14 
    15 #define ZMAGIC_DISK_BLOCK_SIZE  1024
    16 #define BYTES_IN_WORD           4
    17 #define NO_CORE_COMMAND
    18 
    19 #define MY(OP)                  CONCAT2(i386aout_emx_,OP)
    20 #define TARGETNAME              "a.out-emx"
    21 #define NO_WRITE_HEADER_KLUDGE  1
    22 
    23 /* a.out executables emx-specific header */
    24 struct exec
    25 {
    26   unsigned long a_info;         /* Use macros N_MAGIC, etc for access */
    27   unsigned a_text;              /* length of text, in bytes */
    28   unsigned a_data;              /* length of data, in bytes */
    29   unsigned a_bss;               /* length of uninitialized data area for file, in bytes */
    30   unsigned a_syms;              /* length of symbol table data in file, in bytes */
    31   unsigned a_entry;             /* start address */
    32   unsigned a_trsize;            /* length of relocation info for text, in bytes */
    33   unsigned a_drsize;            /* length of relocation info for data, in bytes */
    34 };
    35 
    36 #define N_HEADER_IN_TEXT(x) 0
    37 
    38 #define N_TXTOFF(x)     \
    39     (N_MAGIC(x) != ZMAGIC ? EXEC_BYTES_SIZE : /* object file or NMAGIC */\
    40      N_SHARED_LIB(x) ? 0 : \
    41      N_HEADER_IN_TEXT(x) ?      \
    42             EXEC_BYTES_SIZE :                   /* no padding */\
    43             0x400 + (x).emx_add \
    44     )
    45 
    46 #define N_DATOFF(x) (N_TXTOFF(x) + N_TXTSIZE(x))
    47 
    48 #define IS_STAB(flags) (((flags) & N_STAB) \
    49         && (flags) != (N_IMP1|N_EXT) && (flags) != (N_IMP2|N_EXT))
    50 
    51 /* EXACT TYPES */
    52 typedef char int8e_type;
    53 typedef unsigned char uint8e_type;
    54 typedef short int16e_type;
    55 typedef unsigned short uint16e_type;
    56 typedef int int32e_type;
    57 typedef unsigned int uint32e_type;
    58 
    59 /* CORRECT SIZE OR GREATER */
    60 typedef char int8_type;
    61 typedef unsigned char uint8_type;
    62 typedef short int16_type;
    63 typedef unsigned short uint16_type;
    64 typedef int int32_type;
    65 typedef unsigned int uint32_type;
    66 
    67 #endif /* __I386EMX__H__ */
     3#define HOST_PAGE_SIZE          0x1000
     4#define HOST_SEGMENT_SIZE       0x10000
     5#define HOST_TEXT_START_ADDR    0x10000
     6#define HOST_STACK_END_ADDR     0x80000000
  • trunk/src/binutils/bfd/i386aoutemx.c

    • Property cvs2svn:cvs-rev changed from 1.2 to 1.3
    r728 r729  
    1818Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
    1919
    20 #include "sysdep.h"
    21 #include "bfd.h"
    22 #include "libbfd.h"
    23 #include "libaout.h"
     20#define EMX
    2421
    25 static bfd_boolean MY(set_sizes) ();
     22#define ARCH_SIZE               32
     23#define DEFAULT_ARCH            bfd_arch_i386
     24
     25#define TEXT_START_ADDR         0x10000
     26#define TARGET_PAGE_SIZE        0x1000
     27#define TARGET_SEGMENT_SIZE     0x10000
     28#define TARGET_STACK_END_ADDR   0x80000000
     29
     30#define ZMAGIC_DISK_BLOCK_SIZE  1024
     31#define BYTES_IN_WORD           4
     32#define NO_CORE_COMMAND
     33
     34#define MY(OP)                  CONCAT2(i386aout_emx_,OP)
     35#define TARGETNAME              "a.out-emx"
     36
     37#define IS_STAB(flags) (((flags) & N_STAB) \
     38        && (flags) != (N_IMP1|N_EXT) && (flags) != (N_IMP2|N_EXT))
     39
     40#include "aout/aoutemx.h"
     41#include "aoutx.h"
     42
     43#define MY_object_p             MY(object_p)
    2644#define MY_backend_data &MY(backend_data)
    2745
    28 static const bfd_target *MY(object_p) ();
    29 #define MY_object_p             MY(object_p)
     46static bfd_boolean MY(set_sizes) PARAMS ((bfd *));
     47static const bfd_target *MY(object_p) PARAMS ((bfd *));
    3048
    3149static CONST struct aout_backend_data MY(backend_data) = {
     
    4765#include "aout-target.h"
    4866
     67#ifndef __EMX__
     68
     69/* Cross-compilation support, borrowed from EMX C runtime library */
     70int _fseek_hdr PARAMS ((FILE *));
     71
     72int _fseek_hdr (FILE *stream)
     73{
     74  struct
     75    {
     76      char magic[2];
     77      char fill1[6];
     78      unsigned short hdr_size;
     79    } exe_hdr;
     80  struct
     81    {
     82      char sig[16];
     83      char bound;
     84      char fill1;
     85      unsigned short hdr_loc_lo;      /* cannot use long, alignment! */
     86      unsigned short hdr_loc_hi;
     87    } patch;
     88  long original_pos;
     89  int saved_errno;
     90
     91  original_pos = ftell (stream);
     92  if (fread (&exe_hdr, sizeof (exe_hdr), 1, stream) != 1)
     93    goto failure;
     94  if (memcmp (exe_hdr.magic, "MZ", 2) != 0)
     95    return (fseek (stream, original_pos, SEEK_SET) == -1 ? -1 : 0);
     96  if (fseek (stream, original_pos + 16 * exe_hdr.hdr_size, SEEK_SET) == -1)
     97    goto failure;
     98  if (fread (&patch, sizeof (patch), 1, stream) != 1)
     99    goto failure;
     100  if (memcmp (patch.sig, "emx", 3) != 0)
     101    goto failure;
     102  if (fseek (stream, original_pos + patch.hdr_loc_lo
     103             + 65536L * patch.hdr_loc_hi, SEEK_SET) == -1)
     104    goto failure;
     105  return 0;
     106
     107failure:
     108  saved_errno = errno;
     109  fseek (stream, original_pos, SEEK_SET);
     110  errno = saved_errno;
     111  return -1;
     112}
     113#endif
     114
    49115/*
    50116 * Finish up the reading of an a.out file header
     
    62128  (void)_fseek_hdr(bfd_cache_lookup(abfd));
    63129  add = bfd_tell (abfd) - org_pos;
    64   if (bfd_read ((PTR) &exec_bytes, 1, EXEC_BYTES_SIZE, abfd)
     130
     131  if (bfd_bread ((PTR) &exec_bytes, EXEC_BYTES_SIZE, abfd)
    65132      != EXEC_BYTES_SIZE)
    66133  {
     
    76143
    77144  NAME(aout,swap_exec_header_in)(abfd, &exec_bytes, &exec);
    78   exec.emx_add = add;
     145  exec.a_hdrofs = add;
    79146  target = NAME(aout,some_aout_object_p) (abfd, &exec, MY(callback));
    80147  return target;
  • trunk/src/binutils/bfd/libaout.h

    • Property cvs2svn:cvs-rev changed from 1.3 to 1.4
    r728 r729  
    253253{
    254254    long a_info;                /* Magic number and flags, packed */
    255 #if defined (__EMX__)
    256     long emx_add;
     255#if defined (EMX)
     256    long a_hdrofs;              /* Offset from file start to a.out header */
    257257#endif
    258258    bfd_vma a_text;             /* length of text, in bytes  */
  • trunk/src/binutils/bfd/sysdep.h

    • Property cvs2svn:cvs-rev changed from 1.4 to 1.5
    r728 r729  
    2626
    2727#include "config.h"
    28 
    29 #ifdef __EMX__ /* r=bird: hmm seen this before. */
    30 #ifdef TRAD_HEADER
    31 #include TRAD_HEADER
    32 #endif
    33 #endif /* __EMX__ */
    3428
    3529#ifdef HAVE_STDDEF_H
  • trunk/src/binutils/bfd/targets.c

    • Property cvs2svn:cvs-rev changed from 1.3 to 1.4
    r728 r729  
    935935#endif
    936936        &hp300hpux_vec,
     937        &i386aout_emx_vec,
    937938        &i386aout_vec,
    938939        &i386bsd_vec,
  • trunk/src/binutils/bfd/trad-core.c

    • Property cvs2svn:cvs-rev changed from 1.4 to 1.5
    r728 r729  
    4444#include <sys/user.h>           /* After a.out.h  */
    4545
    46 #ifndef __EMX__ /* r=bird: Code was initially removed. Why don't we include it? anything to do with sysdep.h? */
    4746#ifdef TRAD_HEADER
    4847#include TRAD_HEADER
    4948#endif
    50 #endif /* !__EMX__ */
    5149
    5250struct trad_core_struct
     
    106104
    107105  /* Sanity check perhaps??? */
    108 #ifdef __EMX__                          /* r=bird: EMX not __EMX__ thing?? */
     106#ifdef EMX
    109107  if (u.u_magic != UMAGIC)
    110108    return 0;
    111 #else /* !__EMX__ */
     109#else /* !EMX */
    112110  if (u.u_dsize > 0x1000000)    /* Remember, it's in pages...  */
    113111    {
     
    158156#endif
    159157  }
    160 #endif /* !__EMX__ */
     158#endif /* !EMX */
    161159
    162160  /* OK, we believe you.  You're a core file (sure, sure).  */
Note: See TracChangeset for help on using the changeset viewer.