links2 na amd64

Pawel Sikora pluto w agmk.net
Wto, 10 Maj 2005, 01:52:06 CEST


On Tuesday 10 of May 2005 01:26, Pawel Sikora wrote:
> On Tuesday 10 of May 2005 00:46, Pawel Sikora wrote:
> > On Tuesday 10 of May 2005 00:38, Pawel Sikora wrote:
> > > to widac, ze `man 3 basename` z path_to_exe ==
> > >
> > > (gdb) p path_to_exe
> > > $1 = (unsigned char *) 0x7fbffff860
> > > "/home/users/builder2/rpm/BUILD/links-2.1pre17/links"
> > >
> > > zwraca jakis kosmos...
> > >
> > > (gdb) p bn
> > > $5 = (unsigned char *) 0xffffffffbffff88e
> > > <Address 0xffffffffbffff88e out of bounds>
> >
> >          btw. od 0x7fbffff88e zaczyna sie "links"
>
> no i mam gada.
>
> 0x00000000004b6a88 <init+165>:  callq  0x4065d8 <basename()>
> 0x00000000004b6a8d <init+170>:  cltq
>
> rezultat basename() jest traktowany przez kompilator instukcja
> cltq: sign-extend dword in `eax' to quad in `rax' (x86-64 only)
> co napewno nie wplywa pozytywnie na starsze 32 bity rezultatu basename().
>
> juz zglosilem buga.

zartowalem :>

$ cat bug.c
char* foo(const char* path)
{
    return basename(path);
}

$ x86_64-pld-linux-gcc -O0 -g bug.c -c -S -s
bug.c: In function 'foo':
bug.c:3: warning: return makes pointer from integer without a cast

i gcc slusznie sobie cltq uzywa.
po prostu links2 ssie - brakuje #include <libgen.h>.

bug /closed.

-- 
The only thing necessary for the triumph of evil
  is for good men to do nothing.
                                           - Edmund Burke




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