From patchwork Tue Oct 17 14:30:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Cl=C3=A9ment_Chigot?= X-Patchwork-Id: 78038 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 4F95F3858414 for ; Tue, 17 Oct 2023 14:31:01 +0000 (GMT) X-Original-To: binutils@sourceware.org Delivered-To: binutils@sourceware.org Received: from mail-wr1-x42c.google.com (mail-wr1-x42c.google.com [IPv6:2a00:1450:4864:20::42c]) by sourceware.org (Postfix) with ESMTPS id 4108E3858C52 for ; Tue, 17 Oct 2023 14:30:43 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 4108E3858C52 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=adacore.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=adacore.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 4108E3858C52 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::42c ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1697553044; cv=none; b=NZPkrgstR2o0p9xYOVLoVrBKHFy3M79tKtwHMnHf6/XhA10xsDpDjw3ccohH2+/YoFIloNj9xA3ozC316FfhiesN2QUi6CTZADs5NdmYJmJs5UuZ9va4HtaZ9Lab7bRdr68q82CIIInZm7OITtpU3gPKya2NwhLkaxpFA+EGXDE= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1697553044; c=relaxed/simple; bh=S9yO7VuZqXWX9o7PHeKbdycoECzTl/mgM27yP8FHQq4=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=FFRNzxzVDZhMCV1sUNnNpEAwYGRkAMQosnrEtEf21o+/Qw8H2GYIe2661o7QMAICemZRinZUV9krOcRQ1liGj8b4Q6GqH/5llcxyvEN05nxj+KpboM8s3n9+LQCSoeZvxTXlUnFS08OFiaUo2cR5auNsW5xreDy9L4EoPFeTVVw= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-wr1-x42c.google.com with SMTP id ffacd0b85a97d-32d895584f1so4896553f8f.1 for ; Tue, 17 Oct 2023 07:30:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1697553041; x=1698157841; darn=sourceware.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=ZW3YQAMdrtytJq2hYYqx8DrBPB2C4YcEjXRRpCVBxRM=; b=iuPwXCJYImVloUYr23yXHyd014M82RKHEdfzFEj20shCbr62tefV7GrTOW2BnDhgkE nz3pV/9qwt8nGe3Y5seENL5lSobxfP1UTKNIDFjDJ0287xwTOfaZd31pu9NwCGgaF1Ko yo9x2HcxyqR6yw+jPhlBhz4icOw2MmBnrYujwwVH8hk6wpk1OWsHIP80OvQM7+MCIg3Q X4pkYi8qLLWjI3/jJgILDlb70xdaSP5xxI3MifRFRuJSoQ2uASWgDW7qGvZjvt7u928d LdUfv8qKf0diGaVZC2RocPRLw65Y6APBuHS+n/ZuWvSZbbMWPtHZJR0C0j67yV3qiHmK 7KPw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697553041; x=1698157841; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=ZW3YQAMdrtytJq2hYYqx8DrBPB2C4YcEjXRRpCVBxRM=; b=Hdzci+yFxD6cOdeElIBrM6FG4Iq4Tc6S47yzGLlzRPxeC1swqsRwgTWO1bEvLvpd7f 7affOECN8Jx23dFTaokkRW8MRgbkj5h60fHPQXeLrXb20FsKRN70iY07UKhyAO7y8i2k L/K1c6aIt4nsCUvRRvqRpqojMrftVJGBTyX4h1WbDs7oqId7WXMbLYiBXj62XRgQu28/ aayx505sZ9qzRjwtgI+f36dPCw+uhLA1wvjSsv4AJ6kvLJpGBS2YE+6jcT9rdZdw0CGq 7tqN9vinXZRuxjFTH5FV8cRtaHp4NOxTVBNAt0TDhVl5utyfKqQDnFx8JQe8dDyYexYv 0ULw== X-Gm-Message-State: AOJu0YxrOEZaN6igC22n9Fg+gHiDidpjnXpOn2y5vj8yehbTnl3/FKQZ HxQUN/TTikij4IxfWSECicUwd/Cr1tMS70DPg2I= X-Google-Smtp-Source: AGHT+IE0mU8buXiK07liMis/6dlvJmR9uLSmyHe0sacminBLrBbJEkFn6wdLlJxFJOYTNGYRlz9TYg== X-Received: by 2002:a5d:6903:0:b0:319:7472:f0b6 with SMTP id t3-20020a5d6903000000b003197472f0b6mr2139485wru.15.1697553041533; Tue, 17 Oct 2023 07:30:41 -0700 (PDT) Received: from chigot-Dell.telnowedge.local (lmontsouris-659-1-24-67.w81-250.abo.wanadoo.fr. [81.250.175.67]) by smtp.gmail.com with ESMTPSA id z13-20020adff1cd000000b0031980294e9fsm1804504wro.116.2023.10.17.07.30.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Oct 2023 07:30:41 -0700 (PDT) From: =?utf-8?q?Cl=C3=A9ment_Chigot?= To: binutils@sourceware.org Cc: =?utf-8?q?Cl=C3=A9ment_Chigot?= Subject: [PATCH] objcopy: fix typo in --heap and --stack parser Date: Tue, 17 Oct 2023 16:30:39 +0200 Message-Id: <20231017143039.647013-1-chigot@adacore.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Spam-Status: No, score=-12.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: binutils@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Binutils mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: binutils-bounces+patchwork=sourceware.org@sourceware.org Obvious fix, but I just want to be sure I'm not missing anything regarding the doc update. ---- The help says that and 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 and for --heap and --stack. * doc/binutils.texi: Add 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')