Bug 5391

Summary: ld does not produce magic symbols with names like __start_* and __stop_*,
Product: binutils Reporter: Petr.Salinger
Component: ldAssignee: unassigned
Status: RESOLVED INVALID    
Severity: normal CC: bug-binutils
Priority: P2    
Version: 2.18   
Target Milestone: ---   
Host: Target:
Build: Last reconfirmed:

Description Petr.Salinger 2007-11-21 13:48:44 UTC
The previous versions of ld used to produce symbols __start_foo and __stop_foo
visible in "readelf -a a.out" output for following snippet:

        .text
        .globl  _start
        .type   _start,@function
        .section "foo"
_start:
        ret

This does not work anymore, it breaks building of kernel modules in FreeBSD.

Petr
Comment 1 Alan Modra 2007-11-21 21:45:18 UTC
Since 2007-03-24, ld has only provided these symbols if they are referenced.  So
you'll need some reference in an object file or via -u on the command line if
you want to see them.