Index: wasm/InputChunks.h =================================================================== --- wasm/InputChunks.h +++ wasm/InputChunks.h @@ -51,8 +51,10 @@ uint32_t getOutputOffset() const { return OutputOffset; } ArrayRef getRelocations() const { return Relocations; } + StringRef getFileName() const { return File->getName(); } virtual StringRef getComdat() const = 0; + virtual StringRef getName() const = 0; bool Discarded = false; std::vector OutRelocations; @@ -99,7 +101,7 @@ uint32_t getAlignment() const { return Segment.Data.Alignment; } uint32_t startVA() const { return Segment.Data.Offset.Value.Int32; } uint32_t endVA() const { return startVA() + getSize(); } - StringRef getName() const { return Segment.Data.Name; } + StringRef getName() const override { return Segment.Data.Name; } StringRef getComdat() const override { return Segment.Data.Comdat; } int32_t OutputSegmentOffset = 0; @@ -126,7 +128,7 @@ return C->kind() == InputChunk::Function; } - virtual StringRef getName() const { return Function->Name; } + StringRef getName() const override { return Function->Name; } StringRef getComdat() const override { return Function->Comdat; } uint32_t getOutputIndex() const { return OutputIndex.getValue(); } bool hasOutputIndex() const { return OutputIndex.hasValue(); } Index: wasm/InputChunks.cpp =================================================================== --- wasm/InputChunks.cpp +++ wasm/InputChunks.cpp @@ -113,13 +113,13 @@ } void InputFunction::setOutputIndex(uint32_t Index) { - DEBUG(dbgs() << "InputFunction::setOutputIndex: " << Index << "\n"); + DEBUG(dbgs() << "InputFunction::setOutputIndex: " << getName() << " -> " << Index << "\n"); assert(!hasOutputIndex()); OutputIndex = Index; } void InputFunction::setTableIndex(uint32_t Index) { - DEBUG(dbgs() << "InputFunction::setTableIndex " << Index << "\n"); + DEBUG(dbgs() << "InputFunction::setTableIndex: " << getName() << " -> " << Index << "\n"); assert(!hasTableIndex()); TableIndex = Index; } Index: wasm/Options.td =================================================================== --- wasm/Options.td +++ wasm/Options.td @@ -11,6 +11,7 @@ def _eq: Joined<["--", "-"], name # "=">, Alias(NAME)>; } +// The follow flags are shared with the ELF linker def L: JoinedOrSeparate<["-"], "L">, MetaVarName<"">, HelpText<"Add a directory to the library search path">; @@ -20,7 +21,15 @@ def color_diagnostics_eq: J<"color-diagnostics=">, HelpText<"Use colors in diagnostics">; -// The follow flags are shared with the ELF linker +def entry: S<"entry">, MetaVarName<"">, + HelpText<"Name of entry point symbol">; + +def error_limit: J<"error-limit=">, + HelpText<"Maximum number of errors to emit before stopping (0 = no limit)">; + +def fatal_warnings: F<"fatal-warnings">, + HelpText<"Treat warnings as errors">; + def help: F<"help">, HelpText<"Print option help">; def l: JoinedOrSeparate<["-"], "l">, MetaVarName<"">, @@ -34,43 +43,34 @@ def no_color_diagnostics: F<"no-color-diagnostics">, HelpText<"Do not use colors in diagnostics">; -def no_check_signatures: F<"no-check-signatures">, HelpText<"Don't check function signatures">; +def no_fatal_warnings: F<"no-fatal-warnings">; def o: JoinedOrSeparate<["-"], "o">, MetaVarName<"">, HelpText<"Path to file to write output">; -def threads: F<"threads">, HelpText<"Run the linker multi-threaded">; - -def check_signatures: F<"check-signatures">, HelpText<"Check function signatures">; - -def v: Flag<["-"], "v">, HelpText<"Display the version number">; - -def version: F<"version">, HelpText<"Display the version number and exit">; - -def verbose: F<"verbose">, HelpText<"Verbose mode">; - def relocatable: F<"relocatable">, HelpText<"Create relocatable object file">; def strip_all: F<"strip-all">, HelpText<"Strip all symbols">; def strip_debug: F<"strip-debug">, HelpText<"Strip debugging information">; +def threads: F<"threads">, HelpText<"Run the linker multi-threaded">; + +def v: Flag<["-"], "v">, HelpText<"Display the version number">; + defm undefined: Eq<"undefined">, HelpText<"Force undefined symbol during linking">; -def z: JoinedOrSeparate<["-"], "z">, MetaVarName<"