SOURCES: linux-2.6-gfs-noswitch64.patch (NEW) - (sparc32, ppc) don'...

Paweł Sikora pluto w ds14.agh.edu.pl
Sob, 10 Lip 2004, 22:51:12 CEST


On Saturday 10 of July 2004 21:38, qboosh wrote:
> Author: qboosh                       Date: Sat Jul 10 19:38:47 2004 GMT
> Module: SOURCES                       Tag: HEAD
> ---- Log message:
> - (sparc32,ppc) don't use switch on 64-bit value,
> gcc uses __ucmpdi2() to do it

# man gcc

 -ffreestanding

   Assert that compilation takes place in a freestanding environment.
   This implies -fno-builtin.  A freestanding environment is one in
   which the standard library may not exist, and program startup may
   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   not necessarily be at "main".  The most obvious example is an OS
   kernel.  This is equivalent to -fno-hosted.

$ cat switch64.c

#include "/usr/src/linux/include/linux/types.h"
__u64 test(__u64 val)
{
    switch (val)
    {
        case 0:
            return 0;
            break;
        case 1:
            return 1;
            break;
        default:
            return -1;
    }
}

$ gcc switch64.c -c -ffreestanding
$ objdump -t switch64.o

switch64.o:     file format elf32-sparc

SYMBOL TABLE:
00000000 l    df *ABS*  00000000 switch64.c
00000000 l    d  .text  00000000
00000000 l    d  .data  00000000
00000000 l    d  .bss   00000000
00000000 l    d  .note.GNU-stack        00000000
00000000 l    d  .comment       00000000
00000000         *UND*  00000000 __ucmpdi2
                                 ^^^^^^^^^
00000000 g     F .text  0000009c test

$ objdump -T /lib/libgcc_s.so|grep __uc
0000181c g    DF .text  00000038  GCC_3.0     __ucmpdi2

$ ldd /lib/libgcc_s.so
        libc.so.6 => /lib/libc.so.6 (0x70028000)
        /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x08000000)

ja bym to zglosil jako bug, bo nie jest mozliwe odpalenie
takiego programu bez libc, a opcja -ffreestanding ma to gwarantowac.
niech gcc rozwija to inline, albo zglasza blad/ostrzezenie,
ze nie moze takiej operacji zrealizowac na danej platformie.
to co robi teraz, to obraz glupoty.

-- 
/* Copyright (C) 2003, SCO, Inc. This is valuable Intellectual Property. */

                           #define say(x) lie(x)




Więcej informacji o liście dyskusyjnej pld-devel-pl