public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
From: Chris Morrow <cmorrow@YottaYotta.com>
To: Jonathan Larmour <jlarmour@redhat.co.uk>
Cc: Gary Thomas <gthomas@redhat.com>, ecos-discuss@sourceware.cygnus.com
Subject: Re: [ECOS] 64 bit mips arch, and __DEVTAB__
Date: Wed, 12 Jul 2000 17:00:00 -0000	[thread overview]
Message-ID: <396D0693.B7BE85D8@YottaYotta.com> (raw)
In-Reply-To: <396D0457.CD53B198@redhat.co.uk>

Jonathan Larmour wrote:
> 
> Gary Thomas wrote:
> >
> > On 12-Jul-2000 Chris Morrow wrote:
> > > I'm working on porting eCos to a 64 bit mips cpu and have encountered
> > > a problem with the DEVTAB_ENTRY macro defined in
> > > io/common/current/include/devtab.h. It would appear that gcc is aligning
> > > each piece of data added to the .devtab section on 8 byte boundries.
> [snip]
> 
> OOI I thought it would be interesting to see what gcc does here, with the
> constructor lists. In config/mips/elf64.h it has:
> 
> #define ASM_OUTPUT_CONSTRUCTOR(FILE,NAME)                             \
>   do {                                                                \
>     ctors_section ();                                                 \
>     fprintf (FILE, "\t%s\t", (Pmode == SImode) ? ".word" : ".dword"); \
>     assemble_name (FILE, NAME);                                       \
>     fprintf (FILE, "\n");                                             \
>   } while (0)
> 
> So it explicitly uses assembler. It might be interesting to look at bug.s
> (generated by compiling with --save-temps ) and check that it is gcc adding
> the alignments itself, and not the assembler. Perhaps Chris can send the
> appropriate extract, since it will only take him a second.
> 
> Jifl
> --
> Red Hat, 35 Cambridge Place, Cambridge, UK. CB2 1NS  Tel: +44 (1223) 728762
> "Plan to be spontaneous tomorrow."  ||  These opinions are all my own fault

bug.s as requested.
        .file   1 "bug.c"
gcc2_compiled.:
__gnu_compiled_c:
        .section .text.f,"ax",@progbits
        .align  2
        .globl  f
        .ent    f
f:
        .frame  $fp,8,$31               # vars= 0, regs= 1/0, args= 0,
extra= 0
        .mask   0x40000000,-8
        .fmask  0x00000000,0
        subu    $sp,$sp,8
        sd      $fp,0($sp)
        move    $fp,$sp
        move    $2,$0
        j       $L2
$L2:
        move    $sp,$fp
        ld      $fp,0($sp)
        addu    $sp,$sp,8
        j       $31
        .end    f
        .globl  a
        .section .devtab,"aw",@progbits
        .align  3
        .type    a,@object
        .size    a,28
a:
        .word   $LC0
        .word   $LC0
        .word   1
        .word   f
        .word   f
        .word   1
        .space  4
        .sdata
        .align  3
$LC0:
        .ascii  "a\000"
        .globl  b
        .section .devtab,"aw",@progbits
        .align  3
        .type    b,@object
        .size    b,28
b:
        .word   $LC1
        .word   $LC1
        .word   1
        .word   f
        .word   f
        .word   1
        .space  4
        .sdata
        .align  3
$LC1:
        .ascii  "b\000"
        .section .text._start,"ax",@progbits
        .align  2
        .globl  _start
        .ent    _start
_start:
        .frame  $fp,56,$31              # vars= 8, regs= 2/0, args= 32,
extra= 0
        .mask   0xc0000000,-8
        .fmask  0x00000000,0
        subu    $sp,$sp,56
        sd      $31,48($sp)
        sd      $fp,40($sp)
        move    $fp,$sp
        .set    noreorder
        nop
        .set    reorder
        la      $2,__DEVTAB__
        sw      $2,32($fp)
$L4:
        lw      $2,32($fp)
        la      $3,__DEVTAB_END__
        bne     $2,$3,$L7
        j       $L5
$L7:
        lw      $2,32($fp)
        lw      $3,12($2)
        lw      $4,32($fp)
        jal     $31,$3
        beq     $2,$0,$L8
        lw      $2,32($fp)
        li      $3,1                    # 0x1
        sw      $3,24($2)
        j       $L6
$L8:
        lw      $2,32($fp)
        sw      $0,24($2)
$L9:
$L6:
        lw      $2,32($fp)
        addu    $3,$2,28
        sw      $3,32($fp)
        j       $L4
$L5:
$L3:
        move    $sp,$fp
        ld      $31,48($sp)
        ld      $fp,40($sp)
        addu    $sp,$sp,56
        j       $31
        .end    _start
-- 
Chris Morrow	YottaYotta Inc.
email:		cmorrow@yottayotta.com
phone:		(780) 439 9000 ext 227
web:		http://www.yottayotta.com

      reply	other threads:[~2000-07-12 17:00 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-07-12 15:15 Chris Morrow
2000-07-12 15:24 ` Gary Thomas
2000-07-12 15:52   ` Chris Morrow
2000-07-12 16:50   ` Jonathan Larmour
2000-07-12 17:00     ` Chris Morrow [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=396D0693.B7BE85D8@YottaYotta.com \
    --to=cmorrow@yottayotta.com \
    --cc=ecos-discuss@sourceware.cygnus.com \
    --cc=gthomas@redhat.com \
    --cc=jlarmour@redhat.co.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).