Find the answer to your Linux question:
Results 1 to 2 of 2
I am getting this error on rhl5 -32 bit g++ 4.1.2 error: PIC register '%ebx' clobbered in 'asm' for code: asm ( "xorl %%eax,%%eax\n\t" "cpuid\n\t" : "=a" (MaxInputValue) : : ...
  1. #1
    Just Joined!
    Join Date
    Sep 2008
    Posts
    5

    Question error: PIC register '%ebx' clobbered in 'asm'

    I am getting this error on rhl5 -32 bit g++ 4.1.2

    error: PIC register '%ebx' clobbered in 'asm'

    for code:
    asm
    (
    "xorl %%eax,%%eax\n\t"
    "cpuid\n\t"
    : "=a" (MaxInputValue)
    :
    : "%ebx", "%ecx", "%edx"
    );

    Same code is working on 64 bit machine with same compiler version.

    Has anyone got this type of error?


    Thanks,
    Bharati

  2. #2
    Linux Enthusiast gerard4143's Avatar
    Join Date
    Dec 2007
    Location
    Canada, Prince Edward Island
    Posts
    714
    PIC is position independent code and in 32 bit it uses the ebx register thats why gcc is complaining...note 64 bit doesn't use ebx for PIC...also I'm not 100% sure I'm right on this....Gerard4143
    Make mine Arch Linux

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...