Issue Details (XML | Word | Printable)

Key: PCC-421
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Anders Magnusson
Reporter: Iain Hibbert
Votes: 0
Watchers: 0
Operations

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

section attribute does not provide correct flag for functions

Created: 10/Apr/14 11:21 PM   Updated: 19/Apr/14 09:48 AM
Component/s: C frontend, i386 target, pcc backend
Affects Version/s: None
Fix Version/s: None

Environment: NetBSD 6.99.40/i386


 Description  « Hide
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

 All   Comments   Change History      Sort Order: Ascending order - Click to sort in descending order
Anders Magnusson made changes - 19/Apr/14 05:57 AM
Field Original Value New Value
Assignee Anders Magnusson [ ragge ]
Anders Magnusson made changes - 19/Apr/14 09:48 AM
Status Open [ 1 ] Resolved [ 5 ]
Resolution Fixed [ 1 ]