This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: 64 bit mips arch, and __DEVTAB__


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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]