Issue Details (XML | Word | Printable)

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

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

weak references not working right

Created: 25/Jun/11 03:11 PM   Updated: 07/May/14 06:36 PM
Component/s: i386 target
Affects Version/s: None
Fix Version/s: None

Environment: NetBSD/i386

 Description  « Hide
Weak references, via the __weakref__ attribute do not work correctly,
the example code

#include <stdio.h>

void my_foo(void) __attribute__((__weakref__("foo")));

main(int ac, char *av[])
    printf("my_foo %p\n", my_foo);

    if (my_foo != NULL)

    return 0;

shows the problem, when compiled with pcc results in undefined references to "foo"
what should happen I think, is that the assembler output references "my_foo" and a

   .weakref my_foo,foo

line is emitted, this allows the linker to decide if foo can be resolved, or if it should
supply a nil value..

 All   Comments   Change History      Sort Order: Ascending order - Click to sort in descending order
Anders Magnusson made changes - 01/May/14 05:53 PM
Field Original Value New Value
Assignee Anders Magnusson [ ragge ]
Anders Magnusson made changes - 01/May/14 05:53 PM
Status Open [ 1 ] Resolved [ 5 ]
Resolution Fixed [ 1 ]
Iain Hibbert made changes - 05/May/14 09:10 PM
Resolution Fixed [ 1 ]
Status Resolved [ 5 ] Reopened [ 4 ]
Anders Magnusson made changes - 07/May/14 06:36 PM
Status Reopened [ 4 ] Resolved [ 5 ]
Resolution Fixed [ 1 ]