objcopy: fix typo in --heap and --stack parser
authorClément Chigot <chigot@adacore.com>
Tue, 17 Oct 2023 12:57:25 +0000 (14:57 +0200)
committerClément Chigot <chigot@adacore.com>
Mon, 23 Oct 2023 08:17:47 +0000 (10:17 +0200)
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.

binutils/doc/binutils.texi
binutils/objcopy.c

index 0d46119c1496961ca54df82302eb7b0f306510a5..f94693631c70e606dee379d2e9cd732e0a9def9f 100644 (file)
@@ -1330,10 +1330,10 @@ objcopy [@option{-F} @var{bfdname}|@option{--target=}@var{bfdname}]
         [@option{--pure}]
         [@option{--impure}]
         [@option{--file-alignment=}@var{num}]
-        [@option{--heap=}@var{size}]
+        [@option{--heap=}@var{reserve}[,@var{commit}]]
         [@option{--image-base=}@var{address}]
         [@option{--section-alignment=}@var{num}]
-        [@option{--stack=}@var{size}]
+        [@option{--stack=}@var{reserve}[,@var{commit}]]
         [@option{--subsystem=}@var{which}:@var{major}.@var{minor}]
         [@option{--compress-debug-sections}]
         [@option{--decompress-debug-sections}]
index ba304c218903f576675d7285c86e94e83ac9bb2d..6bc84bd9e844ad75347a78633a28e88361b11b24 100644 (file)
@@ -5910,7 +5910,7 @@ copy_main (int argc, char *argv[])
            char *end;
            pe_heap_reserve = strtoul (optarg, &end, 0);
            if (end == optarg
-               || (*end != '.' && *end != '\0'))
+               || (*end != ',' && *end != '\0'))
              non_fatal (_("%s: invalid reserve value for --heap"),
                         optarg);
            else if (*end != '\0')
@@ -5941,7 +5941,7 @@ copy_main (int argc, char *argv[])
            char *end;
            pe_stack_reserve = strtoul (optarg, &end, 0);
            if (end == optarg
-               || (*end != '.' && *end != '\0'))
+               || (*end != ',' && *end != '\0'))
              non_fatal (_("%s: invalid reserve value for --stack"),
                         optarg);
            else if (*end != '\0')