From de7dd2bdee702cd4a187c09427bd42b7eee239ec Mon Sep 17 00:00:00 2001 From: Nick Clifton Date: Sat, 31 May 2008 16:35:56 +0000 Subject: PR ld/6430 * testsuite/ld-elfcomm/elfcomm.exp (test_sort_common): Test the ascending/descending argument to the --sort-common command line option. * testsuite/ld-elfcomm/sort-common.s: New file. * ld.h (enum sort_order): New. * ldlang.c (lang_check: Fix comment. (lang_common): Sort commons in ascending or descending order. (lang_one_common): Likewise. * lexsup.c (ld_options): Have --sort-common take an option argument. (parse_args): Handle argument to --sort-common. * ld.texinfo (--sort-common): Document new optional argument. * NEWS: Mention new feature. --- ld/ld.texinfo | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'ld/ld.texinfo') diff --git a/ld/ld.texinfo b/ld/ld.texinfo index f4a3473..a2ec34a 100644 --- a/ld/ld.texinfo +++ b/ld/ld.texinfo @@ -1622,13 +1622,14 @@ and SunOS platforms. On SunOS, the linker will automatically create a shared library if the @option{-e} option is not used and there are undefined symbols in the link. -@item --sort-common +@item --sort-common [= ascending | descending] @kindex --sort-common -This option tells @command{ld} to sort the common symbols by alignment when -it places them in the appropriate output sections. First come all the -sixteen-byte aligned symbols, then all the eight-byte, then all the -four-byte, then all the two-byte, and then everything else. This is to -prevent gaps between symbols due to alignment constraints. +This option tells @command{ld} to sort the common symbols by alignment in +ascending or descending order when it places them in the appropriate output +sections. The symbol alignments considered are sixteen-byte or larger, +eight-byte, four-byte, two-byte, and one-byte. This is to prevent gaps +between symbols due to alignment constraints. If no sorting order is +specified, then descending order is assumed. @kindex --sort-section name @item --sort-section name -- cgit v1.1