Bug 33354 - gcc ia64 short data segment overflowed (0x4001e8 >= 0x400000)
gcc ia64 short data segment overflowed (0x4001e8 >= 0x400000)
Product: Red Hat Linux
Classification: Retired
Component: gcc (Show other bugs)
ia64 Linux
medium Severity medium
: ---
: ---
Assigned To: Jakub Jelinek
David Lawrence
Depends On:
  Show dependency treegraph
Reported: 2001-03-27 00:13 EST by John Reiser
Modified: 2007-04-18 12:32 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2001-04-25 09:10:04 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description John Reiser 2001-03-27 00:13:59 EST
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

(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

#include <stdio.h>

	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");
	return 0;
-----end genstring.c

extern void 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 09:09:58 EDT
-G is not recognized IMHO just because of omission in specs,
should fix it (or hand edit
and change line after *cc1: to
  %{profile:-p} %{G*}
Comment 2 Jakub Jelinek 2001-04-28 14:10:39 EDT
-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.