From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id A39F13858D35 for ; Tue, 4 Jul 2023 11:08:12 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org A39F13858D35 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1688468892; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=GW4TeN5iliiMORsPfvAaqT7+rAogl8RbwHDmue4dBiY=; b=A4XBgkGwlkkcuoPIoSB5YMk9a8RsOv78KeNXBsIVS6G8tPDGBP/EGxr++yYFHasOWWkI1i DTPf4O+JSn5HU5HXqbqKkJR7f9agIPB2VajOILBDrkLfgXbpYc+Q2btDZWQ7lvwu2S3Waw GUAIg+sA02/6wkQ7BR6TJ1xjj0RYNto= Received: from mail-qk1-f200.google.com (mail-qk1-f200.google.com [209.85.222.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-466-uTDQZEqJMFS22K93Gsq58A-1; Tue, 04 Jul 2023 07:08:11 -0400 X-MC-Unique: uTDQZEqJMFS22K93Gsq58A-1 Received: by mail-qk1-f200.google.com with SMTP id af79cd13be357-765a1a97103so594576885a.1 for ; Tue, 04 Jul 2023 04:08:11 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688468890; x=1691060890; h=content-transfer-encoding:in-reply-to:subject:from:references:to :content-language:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=GW4TeN5iliiMORsPfvAaqT7+rAogl8RbwHDmue4dBiY=; b=IqnjVtdujtFPud6F6qZOPDzbIncsFktyNYEBw9BhlXEAw9rWoBXsn7RWal7xBukylD pL2bUJgOuTJlGNTOI/+6vUr6Fn6Ve0lPeqPm3lnC6c18RNWEb9+6iCFidbEcb1Gm0XA+ DuiRpfI7UYAVRMDulkJGbWtVUiP/uLpreu0sXm69nNzyPbq9dbyzYzmo81i/5dJr01BK Q8j6ilOnyHytqOIjrcurXeCopwEq+2JaV1hywueE26CsbhxFursGiAqTojoj0azXBrGB jwW7ounhszOUk486MyJ45N7ijI+eHnu0swbUcY807PW3VMVz4GC5Bv6/tVVGy3bZiG2S G4Pg== X-Gm-Message-State: ABy/qLa0JUjJLJRriw2lwnaIb2aXeta2vemAy/beGW4m/KHwWm/c5NC7 CJaPwpM8FxD+xVhuPlHibno4iKd6VADeX+KiqD0sTpkn0NV4DvtqrkUK1aFd+C6DbZGkHeI/C7G YpLB7k+eCe3sMRJg6Hw== X-Received: by 2002:a05:620a:f06:b0:765:87e1:f60b with SMTP id v6-20020a05620a0f0600b0076587e1f60bmr13200663qkl.64.1688468890685; Tue, 04 Jul 2023 04:08:10 -0700 (PDT) X-Google-Smtp-Source: APBJJlFhw/p6Cjg/xKD9oPgZBN+/K6HMw75KS/FvcKEikagcmRypbflklVocMf+g6hVLS2fdkc1+jg== X-Received: by 2002:a05:620a:f06:b0:765:87e1:f60b with SMTP id v6-20020a05620a0f0600b0076587e1f60bmr13200650qkl.64.1688468890428; Tue, 04 Jul 2023 04:08:10 -0700 (PDT) Received: from [192.168.1.7] (adsl-2-solo-172-78.claranet.co.uk. [80.168.172.78]) by smtp.gmail.com with ESMTPSA id pc26-20020a05620a841a00b0076219ec1fbesm7264421qkn.42.2023.07.04.04.08.09 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 04 Jul 2023 04:08:09 -0700 (PDT) Message-ID: Date: Tue, 4 Jul 2023 12:08:08 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.12.0 To: =?UTF-8?Q?Vincent_Rivi=c3=a8re?= , binutils@sourceware.org References: From: Nick Clifton Subject: Re: gas section alignment less than 4 bytes In-Reply-To: X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-GB Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE,TXREP,T_SCC_BODY_TEXT_LINE 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: Hi Vincent, > I wonder if there is a way for gas to generate an object with section alignment less than 4. If you do not mind the section having a name other than .text, then sure: $ cat fred.s .section foo, "ax" nop $ m68k-elf-as fred.s -o fred.o $ m68k-elf-objdump -h fred.o [...] 3 foo 00000002 00000000 00000000 00000034 2**0 CONTENTS, ALLOC, LOAD, READONLY, CODE > I would like to get Algn = 2**1 for all sections. > Is it possible to achieve that? How? If you want to change the alignment of all of the sections, then you cannot do it using gas, but you can using objcopy: $ echo nop | m68k-elf-as -o a.o $ mk68k-elf-objcopy --set-section-alignment=\*=2 a.o b.o $ m68k-elf-objdump -h b.o [...] 0 .text 00000002 00000000 00000000 00000034 2**1 CONTENTS, ALLOC, LOAD, READONLY, CODE 1 .data 00000000 00000000 00000000 00000036 2**1 CONTENTS, ALLOC, LOAD, DATA 2 .bss 00000000 00000000 00000000 00000036 2**1 ALLOC Cheers Nick