target/8569: gcc on alpha does not support global variables in shared objects

kelledin@users.sourceforge.net kelledin@users.sourceforge.net
Wed Nov 20 07:00:00 GMT 2002


>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:



More information about the Gcc-prs mailing list