LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Red Hat (http://www.linuxquestions.org/questions/red-hat-31/)
-   -   Error: operand out of range (http://www.linuxquestions.org/questions/red-hat-31/error-operand-out-of-range-799476/)

anhvuitinh 04-01-2010 07:41 PM

Error: operand out of range
 
Hi,

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) {
huge();
return (0);
}

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

PRINT_N_EXIT:
printf("OK !!!\n");
return;
}
==================================

raybies 04-02-2010 08: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.

--Ray


All times are GMT -5. The time now is 12:34 AM.