bug-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

an extra byte inserted by m68k-apple-aux-as


From: mpsuzuki
Subject: an extra byte inserted by m68k-apple-aux-as
Date: Mon, 20 May 2002 20:36:39 +0900

Hello,

Sorry for question about obsolete proprietary system.

Recently I found an odd behaviour of BFD (possibly) targetted
to m68k-apple-aux, build on i386-pc-linux-gnu.

When I assemble attached short code by native gas (2.10.1) 
running on A/UX 3.0.1, generated COFF header is following:

00000000  01 50 00 03 3C E9 62 80 00 00 00 C6 00 00 00 0D
00000010  00 02 04 2E 74 65 78 74 00 00 00 00 00 00 00 00

The internal of header is defined in /usr/include/filehdr.h, as

unsigned short  f_magic;        /* magic number */
unsigned short  f_nscns;        /* number of sections */
long            f_timdat;       /* time & date stamp */
long            f_symptr;       /* file pointer to symtab */
long            f_nsyms;        /* number of symtab entries */
unsigned short  f_opthdr;       /* sizeof(optional hdr) */
unsigned short  f_flags;        /* flags */

Thus, the header can be decoded as
        f_magic   = 0x0150
        f_nscns   = 0x0003
        f_timedat = 0x3ce96280
        f_symptr  = 0x000000c6
        f_nsyms   = 0x0000000d
        f_opthdr  = 0x0002
        f_flags   = 0x042e

Of course, the generated object file can be linked to working
binary executable.

When I cross-assemble m68k-apple-aux3.0.1-as (built by myself)
on i386-pc-linux-gnu, generated object file has odd header as:

00000000  01 50 00 03 3C E8 87 43 00 00 00 C6 00 00 00 0D
00000010  00 00 02 04 2E 74 65 78 74 00 00 00 00 00 00 00

This looks like as if an extra byte 0x00 is inserted between
f_nsyms and f_opthdr.

m68k-apple-aux3.0.1-objdump can dump object files that is
cross-assembled by m68k-apple-aux3.0.1-as,
but cannot dump objects assembled on native gas on A/UX.

Anybody can reproduce this problem?
And, if this is a bug, which files of BFD I have to read?

Thanks in advance

mpsuzuki

----------------------------------------------------------------
        .file   "hello.c"
gcc2_compiled.:
__gnu_compiled_c:
.text
.LC0:
        .ascii "Hello World\0"
        .even
.globl main
main:
        link %a6,#0
        jbsr __main
        pea .LC0
        jbsr puts
        addql #4,%sp
.L1:
        unlk %a6
        rts




reply via email to

[Prev in Thread] Current Thread [Next in Thread]