<< Back to previous view

[PCC-423] hidden objects are not referenced correctly when using -fPIC Created: 30/Apr/14  Updated: 01/May/14

Status: Resolved
Project: pcc
Component/s: C frontend, Common code, i386 target
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major
Reporter: Iain Hibbert Assignee: Anders Magnusson
Resolution: Fixed Votes: 0
Environment: NetBSD/i386


 Description   
a hidden object is not referenced correctly when using -fPIC compilation mode. The following code illustrates this

extern int foo0 __attribute__((__visibility__("hidden")));
extern int foo1;

int bar(void)
{
        return foo0 + foo1;
}

when compiled with "pcc -fPIC -S test.c" handles a reference to the _GLOBAL_OFFSET_TABLE_, but does not use it for foo0

        movl foo1@GOT(%eax),%edx
        movl foo0,%eax

contrast this with gcc output, which produces

        addl $_GLOBAL_OFFSET_TABLE_, %ecx
        movl foo0@GOTOFF(%ecx), %edx
        movl foo1@GOT(%ecx), %eax

anyway, this causes errors down the line, in the linking part of libraries which are using hidden symbols.





 Comments   
Comment by Anders Magnusson [ 01/May/14 01:01 PM ]
Now i386 outputs hidden vars @GOTOFF instead of nothing.
Generated at Fri Oct 31 05:01:17 CET 2014 using JIRA Enterprise Edition, Version: 3.13.1-#333.