Re: Ask for helping about LD linker

2008-06-02 Thread Nick Clifton

Hi Jian,

But how to remove the unused functions in system library(maybe compile 
the system library without --funciton-sections) when linking program.


Short Answer: It cannot be done.

Long Answer:

If you are linking against a *shared* library then you will not be able 
to remove any functions in the shared library.  (Nor would you want to - 
other programs may need those functions).


If you are linking against a *static* system library (which has not been 
compiled with --ffunction-sections), then unused functions should not 
normally be copied into the executable.  The exception is when an unused 
function is in the same object file inside the library as a used 
function (or used global symbol).  Ie the linker only discards code at 
the object file level.  If some part of an object file inside a static 
library is needed by the executable then the entire contents of that 
object file will be copies into the executable.


Cheers
  Nick


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


[Bug ld/6019] [avr] avr-ld --relax requires --gc-sections

2008-06-02 Thread eric dot weddington at atmel dot com

--- Additional Comments From eric dot weddington at atmel dot com  
2008-06-02 16:37 ---
Patch fixes bug on real-world application. 

Thanks, Nick!

-- 
   What|Removed |Added

 Status|WAITING |NEW


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

--- 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@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-binutils


Re: Re: Ask for helping about LD linker

2008-06-02 Thread jian
Dear Nick,
I see, thank you so much.

Best regards


2008-06-02 



jian 



发件人: Nick Clifton 
发送时间: 2008-06-02  16:32:40 
收件人: jian 
抄送: bug-binutils 
主题: Re: Ask for helping about LD linker 
 
Hi Jian,

> But how to remove the unused functions in system library(maybe compile 
> the system library without --funciton-sections) when linking program.

Short Answer: It cannot be done.

Long Answer:

If you are linking against a *shared* library then you will not be able 
to remove any functions in the shared library.  (Nor would you want to - 
other programs may need those functions).

If you are linking against a *static* system library (which has not been 
compiled with --ffunction-sections), then unused functions should not 
normally be copied into the executable.  The exception is when an unused 
function is in the same object file inside the library as a used 
function (or used global symbol).  Ie the linker only discards code at 
the object file level.  If some part of an object file inside a static 
library is needed by the executable then the entire contents of that 
object file will be copies into the executable.

Cheers
   Nick
___
bug-binutils mailing list
bug-binutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-binutils


Re: Re: Ask for helping about LD linker

2008-06-02 Thread jian
Dear Nick,
Thanks for your advice,It works well according to your advice.
But how to remove the unused functions in system library(maybe compile the 
system library without --funciton-sections) when linking program.

Best regards.

2008-06-02 



jian 



发件人: Nick Clifton 
发送时间: 2008-06-02  15:08:08 
收件人: jian 
抄送: bug-binutils 
主题: Re: Ask for helping about LD linker 
 
Hi Jian,

> Excuse me,I don't know how to  remove unused functions and variable when 
> linking ELF.

Compile your program with --function-sections.  Link your program with 
-Wl,--gc-sections.

Note: This feature is not implemented for all targets.  If it does not 
work for you then it may be that the target you are working with is one 
of the unsupported targets.

Cheers
   Nick
___
bug-binutils mailing list
bug-binutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug gold/6584] kernel image decompression fails on 64bit machines (linked with gold)

2008-06-02 Thread kris dot van dot hees at oracle dot com

--- Additional Comments From kris dot van dot hees at oracle dot com  
2008-06-02 18:47 ---
Verified to be reproducible on my system.  I'm currently looking into this 
problem.

-- 
   What|Removed |Added

Summary| kernel image decompression |kernel image decompression
   |fails on 64bit machines |fails on 64bit machines
   |(linked with gold)  |(linked with gold)


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

--- 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@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug ld/6446] Handling of EF_FRV_PIC

2008-06-02 Thread aoliva at sourceware dot org

--- Additional Comments From aoliva at sourceware dot org  2008-06-03 04:35 
---
The patch does indeed appear to get the code to patch the spec (thanks, Nick!),
but I'm concerned that, at this point, it might be wiser to change the spec to
match the code, for a couple of kernels and libcs might be relying on the
current bug :-(

-- 


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

--- 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@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-binutils