From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-it0-x233.google.com (mail-it0-x233.google.com [IPv6:2607:f8b0:4001:c0b::233]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 9E09F1A1E45 for ; Tue, 13 Sep 2016 10:49:10 -0700 (PDT) Received: by mail-it0-x233.google.com with SMTP id 186so53824174itf.0 for ; Tue, 13 Sep 2016 10:49:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=jv8RgMJoKhms4OeOyFc2zmZIolIr1RmnlOD6dJEGaqE=; b=Nba1YfvE9eH3L9soYGyfauLGg+fCnUrfj0mrtrcWcQYCzkp8jESeg+stBjKxNkSZMA K16hGrA5f5UqpDe9TXmZi5CRvpipB98amKu5L91wl6j+UwDyxqfdiTTGlHGZeuPK+6b+ 30tZRwgkDzQTDWceQWywWPD2CLPlN62gMokHQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=jv8RgMJoKhms4OeOyFc2zmZIolIr1RmnlOD6dJEGaqE=; b=Cvvkvm/YHfkI8IVflu88wZhNvd+Cmd57PByGXIFFzmpIKkFJ3iSeq5mDQx2B4Ytsc9 i4MtVAW0nCmQ7gfF2RqwJml1LxKFRHAJ218flwmIeojKSR3x/7K3lCTmUY/J7M+z5Frh ygKBuIdG+vlr5eNIGE5Powu0iVXPFU2iDUXwjFBHLjbhWyC5zqjjzkfSkr4rsX1E7lOr I66CP/eFLTFArwGXoTtiDr/F6DSBf91ZT81hfzyUS6nNWnGsRKMnMI4194o76kV4fz2E oWV5TFZx2DiBtC5cyhffL1yUFCtR4tBq2NPrEkHHYKlf9s1wOTCCk6njXBPikGnSJx5k 4VGA== X-Gm-Message-State: AE9vXwNmFEIGBLl3/6uusvETgE4P2PgW1KHXEfPQWq78zCkkF+YjvzT6cM3stoJ3p2Upr7YLuuX2iIXV3gKJmzfn X-Received: by 10.107.16.226 with SMTP id 95mr3886964ioq.41.1473788949679; Tue, 13 Sep 2016 10:49:09 -0700 (PDT) MIME-Version: 1.0 Received: by 10.36.204.195 with HTTP; Tue, 13 Sep 2016 10:49:09 -0700 (PDT) In-Reply-To: References: <1473787620-26953-1-git-send-email-ard.biesheuvel@linaro.org> From: Ard Biesheuvel Date: Tue, 13 Sep 2016 18:49:09 +0100 Message-ID: To: Andrew Fish Cc: edk2-devel-01 , Leif Lindholm Subject: Re: [PATCH 2/2] ArmPkg/AsmMacroIoLib: force word alignment for functions X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Sep 2016 17:49:10 -0000 Content-Type: text/plain; charset=UTF-8 On 13 September 2016 at 18:45, Andrew Fish wrote: > >> On Sep 13, 2016, at 10:27 AM, Ard Biesheuvel wrote: >> >> Without an explicit .align directive, the Clang assembler defaults to >> no alignment, which may result in instructions appearing misaligned in >> the final executable. So use word alignment in all cases. >> >> Contributed-under: TianoCore Contribution Agreement 1.0 >> Signed-off-by: Ard Biesheuvel >> --- >> ArmPkg/Include/AsmMacroIoLib.h | 1 + >> 1 file changed, 1 insertion(+) >> >> diff --git a/ArmPkg/Include/AsmMacroIoLib.h b/ArmPkg/Include/AsmMacroIoLib.h >> index fb73ea9a4694..5e4de1f269c8 100644 >> --- a/ArmPkg/Include/AsmMacroIoLib.h >> +++ b/ArmPkg/Include/AsmMacroIoLib.h >> @@ -56,6 +56,7 @@ >> .global Name ; \ >> .section #Section, "ax" ; \ >> .type Name, %function ; \ >> + .align 2 ; \ > > Ard, > > I've been burned in the past by as .align is bytes or power of 2 based on what the native assembler defaults to (over simplification). I'm not sure if that issues exists in the ARM world? > The GNU assembler for ARM interprets this as power-of-2, and so does Clang, according to my testing. Both support the .p2align directive as well, which makes it 100% unambiguous, so I suppose I could use that instead. -- Ard.