Replace abort() with diagnostic message in redo_main()#1554
Open
karesansui-u wants to merge 1 commit intorui314:mainfrom
Open
Replace abort() with diagnostic message in redo_main()#1554karesansui-u wants to merge 1 commit intorui314:mainfrom
karesansui-u wants to merge 1 commit intorui314:mainfrom
Conversation
When mold auto-detects an unsupported target from ELF headers, redo_main() previously called abort() with no context. This replaces it with a descriptive error message matching the style used by the -m flag path in cmdline.cc. Fixes rui314#1553
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
redo_main()calledabort()when no compiled-in target matched the auto-detected architectureAborted (core dumped)with no indication of the causemold: unsupported target: <name>; rebuild mold with the appropriate target supportThis aligns the auto-detection path (
redo_main()inpasses.cc) with the explicit-mpath (cmdline.cc:763), which already provides a helpfulFatal(ctx)message.Details
redo_main()does not have access toContext<E>(it runs beforemold_main<E>creates one), soFatal(ctx)cannot be used. The fix usesstd::cerr+exit(1)instead.Fixes #1553