mold icon indicating copy to clipboard operation
mold copied to clipboard

BFD linker options not recognized by mold

Open marxin opened this issue 2 years ago • 2 comments

When running the binutils test-suite I noticed there are some extra BFD options that mold can't understand:

mold: fatal: unknown command line option: --add-needed
mold: fatal: unknown command line option: --audit=tmpdir/audit.so
mold: fatal: unknown command line option: --copy-dt-needed-entries
mold: fatal: unknown command line option: --depaudit=tmpdir/audit.so
mold: fatal: unknown command line option: --dynamic-list-cpp-new
mold: fatal: unknown command line option: --dynamic-list-cpp-typeinfo
mold: fatal: unknown command line option: --dynamic-list-data
mold: fatal: unknown command line option: -Paudit.so
mold: fatal: unknown command line option: -Ptmpdir/audit.so
mold: fatal: unknown command line option: --traditional-format
mold: warning: unknown command line option: -z indirect-extern-access
mold: warning: unknown command line option: -z lam-u48
mold: warning: unknown command line option: -z lam-u57
mold: warning: unknown command line option: -z nodynamic-undefined-weak
mold: warning: unknown command line option: -z noindirect-extern-access
mold: warning: unknown command line option: -z nopack-relative-relocs
mold: warning: unknown command line option: -z stack-size=0x900000
mold: warning: unknown command line option: -z unique-symbol

You might be interested in any of the features. Please keep this as a compatibility listing, not a need to implement these. Most of the options are unsupported by both gold and lld.

marxin avatar Dec 16 '22 12:12 marxin

stack-size is especially important when using musl instead of glibc because musl has a default of 128k whereas glibc is around 8-10MB. For more complex applications, this makes mold practically unusable with musl ATM.

bigerl avatar Jun 29 '23 06:06 bigerl

-z stack-size has been added in the above commit.

rui314 avatar Jun 29 '23 07:06 rui314