[Bug gold/10880] New: --as-needed doesn't work

View: New views
5 Messages — Rating Filter:   Alert me  

[Bug gold/10880] New: --as-needed doesn't work

by Bugzilla from sourceware-bugzilla@sourceware.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

A simple

 echo "int main() {return 0;}" > testme.c
 gcc -Wl,--as-needed testme.c -o testme -lglib-2.0

will link against glib-2.0 even if it is not used. So

 readelf -d testme|grep -e '(NEEDED)' -e 'glib-2.0'

will not be an empty string.

--
           Summary: --as-needed doesn't work
           Product: binutils
           Version: 2.20
            Status: NEW
          Severity: normal
          Priority: P2
         Component: gold
        AssignedTo: ian at airs dot com
        ReportedBy: robert dot wohlrab at gmx dot de
                CC: bug-binutils at gnu dot org


http://sourceware.org/bugzilla/show_bug.cgi?id=10880

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


_______________________________________________
bug-binutils mailing list
bug-binutils@...
http://lists.gnu.org/mailman/listinfo/bug-binutils

[Bug gold/10880] --as-needed doesn't work

by Bugzilla from sourceware-bugzilla@sourceware.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


------- Additional Comments From robert dot wohlrab at gmx dot de  2009-10-31 22:58 -------
Downstream bug http://bugs.debian.org/553512

--


http://sourceware.org/bugzilla/show_bug.cgi?id=10880

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


_______________________________________________
bug-binutils mailing list
bug-binutils@...
http://lists.gnu.org/mailman/listinfo/bug-binutils

[Bug gold/10880] --as-needed doesn't work

by Bugzilla from sourceware-bugzilla@sourceware.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2009-11-05 06:24 -------
Subject: Bug 10880

CVSROOT: /cvs/src
Module name: src
Changes by: ian@... 2009-11-05 06:24:39

Modified files:
        gold           : ChangeLog layout.cc object.h symtab.cc

Log message:
        PR 10880
        * object.h (class Object): Add is_needed and set_is_needed
        methods.  Add is_needed_ field.  Make bool fields into bitfields.
        * symtab.cc (Symbol_table::set_dynsym_indexes): If a symbol is
        defined in a dynamic object and referenced by a regular object,
        set is_needed for the dynamic object.
        * layout.cc (Layout::finish_dynamic_section): Don't add DT_NEEDED
        if the file is marked with as_needed and it is not needed.

Patches:
http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/gold/ChangeLog.diff?cvsroot=src&r1=1.345&r2=1.346
http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/gold/layout.cc.diff?cvsroot=src&r1=1.144&r2=1.145
http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/gold/object.h.diff?cvsroot=src&r1=1.84&r2=1.85
http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/gold/symtab.cc.diff?cvsroot=src&r1=1.127&r2=1.128



--


http://sourceware.org/bugzilla/show_bug.cgi?id=10880

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


_______________________________________________
bug-binutils mailing list
bug-binutils@...
http://lists.gnu.org/mailman/listinfo/bug-binutils

[Bug gold/10880] --as-needed doesn't work

by Bugzilla from sourceware-bugzilla@sourceware.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2009-11-05 06:25 -------
Subject: Bug 10880

CVSROOT: /cvs/src
Module name: src
Branch: binutils-2_20-branch
Changes by: ian@... 2009-11-05 06:25:01

Modified files:
        gold           : ChangeLog layout.cc object.h symtab.cc

Log message:
        PR 10880
        * object.h (class Object): Add is_needed and set_is_needed
        methods.  Add is_needed_ field.  Make bool fields into bitfields.
        * symtab.cc (Symbol_table::set_dynsym_indexes): If a symbol is
        defined in a dynamic object and referenced by a regular object,
        set is_needed for the dynamic object.
        * layout.cc (Layout::finish_dynamic_section): Don't add DT_NEEDED
        if the file is marked with as_needed and it is not needed.

Patches:
http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/gold/ChangeLog.diff?cvsroot=src&only_with_tag=binutils-2_20-branch&r1=1.281.2.9&r2=1.281.2.10
http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/gold/layout.cc.diff?cvsroot=src&only_with_tag=binutils-2_20-branch&r1=1.134.2.2&r2=1.134.2.3
http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/gold/object.h.diff?cvsroot=src&only_with_tag=binutils-2_20-branch&r1=1.78.2.1&r2=1.78.2.2
http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/gold/symtab.cc.diff?cvsroot=src&only_with_tag=binutils-2_20-branch&r1=1.121.2.1&r2=1.121.2.2



--


http://sourceware.org/bugzilla/show_bug.cgi?id=10880

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


_______________________________________________
bug-binutils mailing list
bug-binutils@...
http://lists.gnu.org/mailman/listinfo/bug-binutils

[Bug gold/10880] --as-needed doesn't work

by Bugzilla from sourceware-bugzilla@sourceware.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


------- Additional Comments From ian at airs dot com  2009-11-05 06:26 -------
Thanks for the bug report.  I committed a patch to implement --as-needed.  
Previously the option was recognized and more or less ignored.

--
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED


http://sourceware.org/bugzilla/show_bug.cgi?id=10880

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


_______________________________________________
bug-binutils mailing list
bug-binutils@...
http://lists.gnu.org/mailman/listinfo/bug-binutils