aboutsummaryrefslogtreecommitdiff
path: root/ld/lexsup.c
diff options
context:
space:
mode:
Diffstat (limited to 'ld/lexsup.c')
-rw-r--r--ld/lexsup.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/ld/lexsup.c b/ld/lexsup.c
index dad3b60..4125d84 100644
--- a/ld/lexsup.c
+++ b/ld/lexsup.c
@@ -487,6 +487,9 @@ static const struct ld_option ld_options[] =
{ {"sort-section", required_argument, NULL, OPTION_SORT_SECTION},
'\0', N_("name|alignment"),
N_("Sort sections by name or maximum alignment"), TWO_DASHES },
+ { {"section-ordering-file", required_argument, NULL, OPTION_SECTION_ORDERING_FILE},
+ '\0', N_("FILE"),
+ N_("Sort sections by statements in FILE"), TWO_DASHES },
{ {"spare-dynamic-tags", required_argument, NULL, OPTION_SPARE_DYNAMIC_TAGS},
'\0', N_("COUNT"), N_("How many tags to reserve in .dynamic section"),
TWO_DASHES },
@@ -1400,6 +1403,12 @@ parse_args (unsigned argc, char **argv)
einfo (_("%F%P: invalid section sorting option: %s\n"),
optarg);
break;
+ case OPTION_SECTION_ORDERING_FILE:
+ if (command_line.section_ordering_file != NULL
+ && strcmp (optarg, command_line.section_ordering_file) != 0)
+ einfo (_("%P: warning: section ordering file changed. Ignoring earlier definition\n"));
+ command_line.section_ordering_file = optarg;
+ break;
case OPTION_STATS:
config.stats = true;
break;