• R
    have configure check/add -ffunction-sections and -fdata-sections · 27c1eccf
    Rich Felker 提交于
    based on patch by Denys Vlasenko. the original intent for using these
    options was to enable linking optimizations. these are immediately
    available for static linking applications to libc.a, and will also be
    used for linking libc.so in a subsequent commit.
    
    in addition to the original motives, this change works around a whole
    class of toolchain bugs where the compiler generates relative address
    expressions using a weak symbol and the assembler "optimizes out" the
    relocation which should result by using the weak definition. (see gas
    pr 18561 and gcc pr 66609, 68178, etc. for examples.) by having
    different functions and data objects in their own sections, all
    relative address expressions are cross-section and thus cannot be
    resolved to constants until link time. this allows us to retain
    support for affected compiler/assembler versions without invasive
    and fragile source-level workarounds.
    27c1eccf
configure 19.4 KB