-   Red Hat (
-   -   Error: operand out of range (

anhvuitinh 04-01-2010 08:41 PM

Error: operand out of range

I need to write a simple app that is huge in size (256 MB) but I can only got it up to 31 MB and got compiler error if I went greater than 32 MB.
/tmp/cc7Ax35n.s:246: Error: operand out of range (0x02000004 is not between 0xfe000000 and 0x01ffffff).

I tried to change ulimit -l and -s options but it didn't help.
Does anyone know why I got the compiler error and how to fix it?
I am running RHEL 5.4. Thanks.

Here is my huge.c code:
#include <stdio.h>

void huge(void);

int main(int argc, char** argv) {
return (0);

void huge()
int x=0;
printf(">>> HUGE FILE LOADS ");
if (x==0) {
__asm__(".ds.b 32*1024*1024\n\t");

printf("OK !!!\n");

raybies 04-02-2010 09:12 AM

Have you checked the /etc/profile to see if ulimit isn't set for the whole system?

I ran your program on my system, even with 256 MB and was able to get it to run.


All times are GMT -5. The time now is 05:57 PM.