This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
target/8569: gcc on alpha does not support global variables in shared objects
- From: kelledin at users dot sourceforge dot net
- To: gcc-gnats at gcc dot gnu dot org
- Date: 14 Nov 2002 01:06:27 -0000
- Subject: target/8569: gcc on alpha does not support global variables in shared objects
- Reply-to: kelledin at users dot sourceforge dot net
>Number: 8569
>Category: target
>Synopsis: gcc on alpha does not support global variables in shared objects
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Wed Nov 13 17:16:01 PST 2002
>Closed-Date:
>Last-Modified:
>Originator: kelledin@users.sourceforge.net
>Release: gcc-3.2
>Organization:
>Environment:
>Description:
The toolchain (I suspect gcc in particular) is unable to support shared objects where the code makes references to global variables in the same shared object. In short, when the code references one of its global variables, gcc generates a gp-relative relocation in the resulting assembly language. When trying to link this into a shared object, ld notices this gp-relative relocation and refuses to link.
FYI, I'm also using binutils-2.13, plus glibc-2.2.5.
>How-To-Repeat:
Attempt to build a shared object with the following code segment:
--------
#include <stdio.h>
int num=1;
int func()
{
printf("%d\n", num);
return 0;
}
--------
>Fix:
none known
>Release-Note:
>Audit-Trail:
>Unformatted: