This is the mail archive of the mailing list for the glibc project.

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

Re: Thanks (__cmpdi2) and...

> _syscall3(int, perf, int op, int counter, int event);
> When doing: gcc -fpic -g -Wall foo.c 
> I get: Fixed or forbidden register 3 (bx) spilled for class BREG.
> Error, bomb, choke...
> I realize that this is not really a glibc question, so feel free to
> ignore. Last one, I promise!

It is a question both related to the kernel and glibc. When you declare
such as syscall, it is expanded in an asm block where the ebx registry
is used to transmit parameters to the kernel with interrupt 0x80.
The problem is that ebx is used by the PIC encoding for something I
don't remember (it contains the address of sth... the glibc guys will
explain this better than me). But the result is that there is a clash
between the do.

Something I noticed, which might as well considered as a bug somehow, is
that if you compile your code without "-fpic" and still link your .o
files as a shared library, you don't have that clash and the library is
still working. I don't know exactly what is the mechanics behind this,
maybe the library becomes unstable...

Any explanation or link to related documents ?

A chicken is an egg's way of producing more eggs.

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