This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]