<< Back to previous view

[PCC-421] section attribute does not provide correct flag for functions Created: 10/Apr/14  Updated: 19/Apr/14

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

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


 Description   
the section attribute does not provide the "x" bit for executable code. For example, the code snippet

void __attribute__ ((__section__(".text.foo"))) foo(void)
{
}

when compiled with "pcc -S foo.c" produces

        .section .text.foo,"aw",@progbits
        .align 4
        .globl foo
        .type foo,@function
foo:
        pushl %ebp
        movl %esp,%ebp
.L93:
.L95:
.L94:
        leave
        ret
        .size foo,.-foo
        .ident "PCC: pcc 1.1.0.DEVEL 20140410 for netbsd-i386"

but the flags for this section should really be "ax", indicating executable code

 Comments   
Comment by Anders Magnusson [ 19/Apr/14 09:48 AM ]
Fixed now, for all affected targets.
Generated at Mon Nov 24 04:52:59 CET 2014 using JIRA Enterprise Edition, Version: 3.13.1-#333.