public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] objcopy: fix typo in --heap and --stack parser
@ 2023-10-17 14:30 Clément Chigot
  0 siblings, 0 replies; only message in thread
From: Clément Chigot @ 2023-10-17 14:30 UTC (permalink / raw)
  To: binutils; +Cc: Clément Chigot

Obvious fix, but I just want to be sure I'm not missing anything
regarding the doc update. 

---- 

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 | 4 ++--
 binutils/objcopy.c         | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/binutils/doc/binutils.texi b/binutils/doc/binutils.texi
index 0d46119c149..f94693631c7 100644
--- a/binutils/doc/binutils.texi
+++ b/binutils/doc/binutils.texi
@@ -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}]
diff --git a/binutils/objcopy.c b/binutils/objcopy.c
index ba304c21890..6bc84bd9e84 100644
--- a/binutils/objcopy.c
+++ b/binutils/objcopy.c
@@ -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')
-- 
2.25.1


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-10-17 14:30 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-10-17 14:30 [PATCH] objcopy: fix typo in --heap and --stack parser Clément Chigot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).