[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug ld/22677] ld -r --gc-section does not KEEP .init_array/.fini_array

From: nickc at redhat dot com
Subject: [Bug ld/22677] ld -r --gc-section does not KEEP .init_array/.fini_array
Date: Thu, 11 Jan 2018 17:02:37 +0000


--- Comment #4 from Nick Clifton <nickc at redhat dot com> ---
Created attachment 10728
  --> https://sourceware.org/bugzilla/attachment.cgi?id=10728&action=edit
Proposed patch

Hi David,

  Sorry - I missed the "-r" option in your initial bug report.

  This does pose an interesting problem however as your linker script 
  fragment is only a partial solution.  The .init_array and .fini_array 
  sections can have a priority value as a suffix to their name, and this 
  suffix must be preserved when linking with -r.  (See 
  ld/testsuite/ld-elf/init-fini-arrays.[sd] for an example of this). Hence 

     .init_array { KEEP (.init_array.*) }

  will not work as it looses the section suffixes.  So instead I am proposing
  the attached patch which adds a special case for init and fini arrays to 
  the garbage collection code in the BFD library.  Please could you try it
  out and let me know if it works for you.


You are receiving this mail because:
You are on the CC list for the bug.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]