Bug 33354 - gcc ia64 short data segment overflowed (0x4001e8 >= 0x400000)
Summary: gcc ia64 short data segment overflowed (0x4001e8 >= 0x400000)
Status: CLOSED RAWHIDE
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: gcc
Version: 7.3
Hardware: ia64
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact: David Lawrence
URL:
Whiteboard:
Keywords:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2001-03-27 05:13 UTC by John Reiser
Modified: 2007-04-18 16:32 UTC (History)
1 user (show)

(edit)
Clone Of:
(edit)
Last Closed: 2001-04-25 13:10:04 UTC


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2001:082 high SHIPPED_LIVE New version of GCC 2.96-RH available fixing several bugs 2001-06-14 04:00:00 UTC

Description John Reiser 2001-03-27 05:13:59 UTC
From Bugzilla Helper:
User-Agent: Mozilla/4.75 [en] (X11; U; Linux 2.2.5-15 i586)


There is no way to compile and load a program which uses
more than 262144 string constants.  On other platforms,
"-fpic" and/or "-G 8" can be used to generate
"worst case" code that has "no limits" other than the full
address space.  But currently on ia64, -G is unrecognized
and code compiled -fpic still can get "short data segment
overflow".

(This specific reproducible test case is abstracted from
a real program which is too cumbersome to present in a bug report.)

Reproducible: Always
Steps to Reproduce:
1.compile & run generator program genstring.c:
    gcc genstring.c; ./a.out  ## generates f0.c .. f511.c
2.compile a main program and the 512 generated files:
    gcc -c -fpic main.c f*.c
3.attempt to link
    gcc main.o f*.o

----genstring.c
#include <stdio.h>

main()
{
	int f0,f1,g,h;
    for (h=0; h<512; ++h) {
	char buf[10];
	FILE *file;
	sprintf(buf, "f%d.c", h);
	file = fopen(buf, "w");
	for (f0=0; f0<64; ++f0) {
		fprintf(file, "static char ");
		for (f1=8; --f1>=0; ) {
			fprintf(file, "*s%d%s",
				(f0<<3)|f1, ((0!=f1) ? "," : ";\n") );
		}
	}
	fprintf(file, "void f%d(){\n", h);
	for (f0=0; f0<64; ++f0) {
		for (f1=8; --f1>=0; ) {
			fprintf(file, "\ts%d=\"string %d\";\n",
				(f0<<3)|f1, (f0<<3)|f1 );
		}
	}
	fprintf(file, "}\n");
    	fflush(file);
	fclose(file);
    }
	return 0;
}
-----end genstring.c

-----main.c
extern void f128();
main()
{
	f128();
}
-----end main.c

	

Actual Results:
ld: a.out: short data segment overflowed (0x4001e8 >= 0x400000)
collect2: ld returned 1 exit status


Expected Results:  Successful completion of load with no complaint.

Comment 1 Jakub Jelinek 2001-04-25 13:09:58 UTC
-G is not recognized IMHO just because of omission in specs,
http://gcc.gnu.org/ml/gcc-patches/2001-04/msg01196.html
should fix it (or hand edit
/usr/lib/gcc-lib/ia64-redhat-linux/2.96/specs
and change line after *cc1: to
  %{profile:-p} %{G*}

Comment 2 Jakub Jelinek 2001-04-28 18:10:39 UTC
-G is supported on ia64 in gcc-2.96-82.


Note You need to log in before you can comment on or make changes to this bug.