浏览代码

have configure check/add --gc-sections linker option

this allowing the linker to drop certain weak definitions that are
only used as dummies for static linking. they could be eliminated for
shared library builds using the preprocessor instead, but we are
trying to transition to using the same object files for shared and
static libc, so a link-time solution is preferable.
Rich Felker 9 年之前
父节点
当前提交
6a851e3ab8
共有 1 个文件被更改,包括 4 次插入0 次删除
  1. 4 0
      configure

+ 4 - 0
configure

@@ -521,6 +521,10 @@ fi
 tryldflag LDFLAGS_AUTO -Wl,--sort-section,alignment
 tryldflag LDFLAGS_AUTO -Wl,--sort-section,alignment
 tryldflag LDFLAGS_AUTO -Wl,--sort-common
 tryldflag LDFLAGS_AUTO -Wl,--sort-common
 
 
+# When linking shared library, drop dummy weak definitions that were
+# replaced by strong definitions from other translation units.
+tryldflag LDFLAGS_AUTO -Wl,--gc-sections
+
 # Some patched GCC builds have these defaults messed up...
 # Some patched GCC builds have these defaults messed up...
 tryldflag LDFLAGS_AUTO -Wl,--hash-style=both
 tryldflag LDFLAGS_AUTO -Wl,--hash-style=both