Issue Details (XML | Word | Printable)

Key: PCC-30
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Gregory McGarry
Reporter: Gregory McGarry
Votes: 0
Watchers: 0

If you were logged in you would be able to see more operations.

indirect function calls dont work on OSX i386

Created: 09/Feb/09 11:36 PM   Updated: 20/Feb/09 08:14 AM
Component/s: i386 target
Affects Version/s: None
Fix Version/s: None

Environment: OSX i386

 Description  « Hide
This may be a general PIC issue. The following code generates indirect function calls:

#include <stdlib.h>

return 0;

like this:

        movl $L_abort$stub,%eax
        call *%eax

The linker complains that that this isn't valid PIC code. It can be changed to this:

        call L_abort$stub

or like:

movl L_abort$non_lazy_ptr,%eax
call *%eax

Need to check how this is handled on powerpc and update i386 target accordingly.

It's interesting that this piece of code fails, while pcc-tests/tests/c/codgen/types2.c works okay.

 All   Comments   Change History      Sort Order: Ascending order - Click to sort in descending order
Gregory McGarry added a comment - 20/Feb/09 08:14 AM
Added appropriate template for UCALL to match powerpc target.