objcopy: fix typo in --heap and --stack parser

The help says that <reserve> and <commit> should be separated by a ","
but the implementation is checking for ".". Having two numbers being
separated by a "." could be confusing, thus adjust the implementation to
match the help syntax.

binutils/ChangeLog:

	* objcopy.c (copy_main): Set separator to "," between <reserve>
	and <commit> for --heap and --stack.
	* doc/binutils.texi: Add <commit> for --heap and --stack.
This commit is contained in:
Clément Chigot 2023-10-17 14:57:25 +02:00
parent 4d47dfdba3
commit be381d7175
2 changed files with 4 additions and 4 deletions

View File

@ -1330,10 +1330,10 @@ objcopy [@option{-F} @var{bfdname}|@option{--target=}@var{bfdname}]
[@option{--pure}] [@option{--pure}]
[@option{--impure}] [@option{--impure}]
[@option{--file-alignment=}@var{num}] [@option{--file-alignment=}@var{num}]
[@option{--heap=}@var{size}] [@option{--heap=}@var{reserve}[,@var{commit}]]
[@option{--image-base=}@var{address}] [@option{--image-base=}@var{address}]
[@option{--section-alignment=}@var{num}] [@option{--section-alignment=}@var{num}]
[@option{--stack=}@var{size}] [@option{--stack=}@var{reserve}[,@var{commit}]]
[@option{--subsystem=}@var{which}:@var{major}.@var{minor}] [@option{--subsystem=}@var{which}:@var{major}.@var{minor}]
[@option{--compress-debug-sections}] [@option{--compress-debug-sections}]
[@option{--decompress-debug-sections}] [@option{--decompress-debug-sections}]

View File

@ -5910,7 +5910,7 @@ copy_main (int argc, char *argv[])
char *end; char *end;
pe_heap_reserve = strtoul (optarg, &end, 0); pe_heap_reserve = strtoul (optarg, &end, 0);
if (end == optarg if (end == optarg
|| (*end != '.' && *end != '\0')) || (*end != ',' && *end != '\0'))
non_fatal (_("%s: invalid reserve value for --heap"), non_fatal (_("%s: invalid reserve value for --heap"),
optarg); optarg);
else if (*end != '\0') else if (*end != '\0')
@ -5941,7 +5941,7 @@ copy_main (int argc, char *argv[])
char *end; char *end;
pe_stack_reserve = strtoul (optarg, &end, 0); pe_stack_reserve = strtoul (optarg, &end, 0);
if (end == optarg if (end == optarg
|| (*end != '.' && *end != '\0')) || (*end != ',' && *end != '\0'))
non_fatal (_("%s: invalid reserve value for --stack"), non_fatal (_("%s: invalid reserve value for --stack"),
optarg); optarg);
else if (*end != '\0') else if (*end != '\0')