From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ej1-x62e.google.com (mail-ej1-x62e.google.com [IPv6:2a00:1450:4864:20::62e]) by sourceware.org (Postfix) with ESMTPS id B27BC3858D38 for ; Tue, 26 Mar 2024 13:08:22 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org B27BC3858D38 Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org B27BC3858D38 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::62e ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1711458504; cv=none; b=KrDsuNH1bkJnfHhSz+gqLAbEhfilpFTW/4r7qvb2+GwczXCEjgau6vkmeYKuML1BMmJbQPcG5X0Oaodg/X8WO4iltJywWykvJF3bH5eGIQuStKmd7AxApae5DEAUnZBKnFSRT7Uk/ays69K3kWiyMb5w/LrSSGF7DK5PScVChXA= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1711458504; c=relaxed/simple; bh=Xnv1CXVbJnxW3ZQML9X4/RMDBbGzm7B42+HTgzafDLE=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=Vv9FbhaxTHwHNVNImMEF3fKVaoCfwMwEKtOnthDLsWracmrrBPSKMlBtIWRUUeLJ+GCXvRrsNsKuvaiH2/6bXdF6q4KVpH6qu4Po1R8/y+FcXlHQ5mdOlZRLHlqXvverL0bNwtEByAr25hoQ7ix3FLSMCLAll6epip9SZUBvxz8= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-ej1-x62e.google.com with SMTP id a640c23a62f3a-a44665605f3so641335166b.2 for ; Tue, 26 Mar 2024 06:08:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1711458501; x=1712063301; darn=sourceware.org; h=content-transfer-encoding:in-reply-to:autocrypt:from:references:cc :to:content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=s+Fjdby+XIYl3fTuUHb0iftZti66W1NgDjKrGtWEiSM=; b=bZaEn3kRZdnRbj6WR4CJVozCbOU3RMPHzy5wT6aZBCqhruWLzJX9Y+5+Vfu2gdMz/c 9/e658cJaWH+zlRA8tiH98ukRSEPFBhJMv37+pA6aKkwibewWvo4mo5cxNRDUmvM6oJZ tXhnZ+itfs24dQ6SdgKGmb763jcwhxEyxiLQtKJG9LaDcPw0e2hFwYTBlEBYCwH61+Wq RqILdJeo8yDiQlSWQdxe0k7OIIuOZxNlA+X/v+6FV8kUXw2o6k1F0DEOg0UgvhwoZWbY 512EecHNrAGW9Y5cVOnv9RlRpkYp/OYfgrQZaEUtwfOFNmZ69oxIxyV0wF0Adoz0jCwy ZQ5A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711458501; x=1712063301; h=content-transfer-encoding:in-reply-to:autocrypt:from:references:cc :to:content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=s+Fjdby+XIYl3fTuUHb0iftZti66W1NgDjKrGtWEiSM=; b=I34A1OJuQKtXSDlVUzCaXALoL3pOyT3rPRWvF74xXFJsO0qtNBlCOeMwfAIuaa8uM4 DZAPYyIB8HrzXIWxsHrdHfJ7tueFX4zwgWbNHSWcAfu8fmlwdbjLoee3ArzElsAenNjR MKCu0cXzfVG6IKDM1fGZWBvqCsYcw0y5V+DmzHlx5a23gA4OHmtn0OUkVaO0qzhqmQQQ E9GJDC0e2rxmWBYUoPyzAoz0KYiM1y8iFFgMVRD14l40Va1XrLm72xm0g40E+GaY4FPH NCjFNAARzc/XWAPkCcJ2GOav9cdRrzcckWSrQH1KElgKuzCL7+FFxRNQFcqIJlHmOhO7 Za2w== X-Gm-Message-State: AOJu0YwWO1i6Ejf6YCQ8niluW7z9mxyU8Ug84K2k9P6SJSu/nUMNsaJw TogOanrSU2fzLP2LjLWV410uMkRz6U6p7VwIvvgG1M0mah40ue34axazdhwBNQ== X-Google-Smtp-Source: AGHT+IGdZjuZ24TymZLUI1SfpnbUB2Cb4PWg14ryEGNfasx5Vvy5dkkhBL89berIj6WUGcqn4txj2A== X-Received: by 2002:a17:906:6a04:b0:a47:4d8d:9483 with SMTP id qw4-20020a1709066a0400b00a474d8d9483mr6352505ejc.59.1711458501330; Tue, 26 Mar 2024 06:08:21 -0700 (PDT) Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de. [37.24.206.209]) by smtp.gmail.com with ESMTPSA id b4-20020a170906708400b00a46da83f7fdsm4234250ejk.145.2024.03.26.06.08.20 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 26 Mar 2024 06:08:21 -0700 (PDT) Message-ID: <8731b9a2-f68c-4659-b7e2-1980c27ce676@suse.com> Date: Tue, 26 Mar 2024 14:08:20 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: RFC: Objcopy: Section alignment Content-Language: en-US To: Nick Clifton Cc: binutils@sourceware.org References: <875xxf63e7.fsf@redhat.com> <494659da-1a66-48a9-976d-da19ab55a87e@suse.com> From: Jan Beulich Autocrypt: addr=jbeulich@suse.com; keydata= xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6U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1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A nAuWpQkjM1ASeQwSHEeAWPgskBQL In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3025.2 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_NONE,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 List-Id: On 26.03.2024 13:44, Nick Clifton wrote: > Hi Jan, > >>> It was recently pointed out to me that objcopy's --section-alignment >>> option does not actually set the alignment of any sections. It just >>> sets a field in the PE file format's optional header. This is rather >>> confusing for the user. >> >> Hmm. For one --file-alignment would then want similar treatment, but >> afaict that might be more difficult to achieve (sections would need >> moving around in the file). Plus I seem to vaguely recall that there >> wants to be a certain correlation between section and file alignments >> of individual sections, which you may break with such an adjustment. > > Agreed. I think that I will leave file alignment alone for now. If necessary > that can be the subject of a future patch. > >> ... by doing this adjustment, aren't you at risk of creating overlapping >> sections? Should --set-section-alignment= perhaps be limited to >> relocatable files? > > Or better yet - not done at all and just left to the user to fix... > > So here is a revised patch that does not change the VMAs or LMAs to match > new section aligments, but instead issues an error message if they do not > match. It also updates the documentation to warn users about this behaviour > and about the dangers of changing the VMAs of fully linked binaries. > > Any further comments ? Actually, there are: First, is the last doc hunk still applicable / appropriately worded? "ensures" in particular I'm not sure about. Perhaps related to that, the two new diagnostics look more like errors than warnings to me. I think those ought to be just warnings (by default at least), especially also with the FIXME for the LMA related code. Which would in particular mean to not bail early from setup_section(), and perhaps also to not set "status" to non-zero. Further, while the new power_of_two() is merely split out code, that code doesn't (already didn't before) deal with 0 properly. It would spin indefinitely then afaict, rather than reporting "not a power of two". Finally, in the new --section-alignment related diagnostic, wouldn't you better mention the option name, and not the internal variable's? Jan