+ Sort_commons_order sort_order;
+ if (!parameters->options().user_set_sort_common())
+ sort_order = SORT_COMMONS_BY_SIZE_DESCENDING;
+ else
+ {
+ const char* order = parameters->options().sort_common();
+ if (*order == '\0' || strcmp(order, "descending") == 0)
+ sort_order = SORT_COMMONS_BY_ALIGNMENT_DESCENDING;
+ else if (strcmp(order, "ascending") == 0)
+ sort_order = SORT_COMMONS_BY_ALIGNMENT_ASCENDING;
+ else
+ {
+ gold_error("invalid --sort-common argument: %s", order);
+ sort_order = SORT_COMMONS_BY_SIZE_DESCENDING;
+ }
+ }
+