From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.1 required=5.0 tests=DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 9326 invoked from network); 6 May 2021 13:19:08 -0000 Received: from mother.openwall.net (195.42.179.200) by inbox.vuxu.org with ESMTPUTF8; 6 May 2021 13:19:08 -0000 Received: (qmail 31789 invoked by uid 550); 6 May 2021 13:19:05 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Reply-To: musl@lists.openwall.com Received: (qmail 9982 invoked from network); 6 May 2021 12:34:36 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=7iqO0m2YuDxMsxpTrPWBj+gmsiQaCP8Bxuaa1fAVxAc=; b=cVOJt1crafXR6SsJz41eic+v6o9N1+PzXR9L5c2YEkudeh39X9uRCur97cFvNDtKbS O1wGoZP8+MTsGyacXyWW/jowAOesVT23l9tk0NlL0Q9RN2z8AUFzeL+Qz7pIRVD937jK YEsKHU0DPSM4fErYixJyWGFpUQqGixpO9lev6nn4h2+LTN1GAk/ss4ac9hWjlFN4CcHF +KNCTWjA9IOTnN0vE6qQaHdUFuF2hL0+qjJS34LG1uSfMkHSChASuDdGrsCBg/e9xpeh lZCT0dcseYNqlQY77o2hL3yjEYU+MBQmJLxz97aCkHoRYXAWbS/RL3/DaQyqvzNlY4Yu ITOg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=7iqO0m2YuDxMsxpTrPWBj+gmsiQaCP8Bxuaa1fAVxAc=; b=TJghpF8i1gOnduq4yPNW6Y3oB1p7tG3aYbcJ24NL/x0JHBRWs3iMW+263vtfpfP/Nx ptquBf5CfV09wfd4wVmX2eoL+WG9nS2D4XfVDCYutSAXa8FrlJGQSIBp5JycRQTNH/+W z6ylbYzVA9P7HKdPNWf9NzjOBfxKXc+McRDCz8Ll7b+L9mj8WSWg4PDc+VYAvN6n/Kyx 9KhGX0DxUuzo2lmu+n84rxYqEXXSa2ppcBEMktnd1vFg1pxEdZWcCyrBifUtseJaAVKx KA/b1eSX1Nzk8t6uDHNsMn/MKxg/KRBZsQ4Gz8+xiDDoqV7gA1blNTdKowReVaS+K37U icJg== X-Gm-Message-State: AOAM5339BwMfrn7bekxMOnp46kP1W228is65HPhNINrzBFubD5MQ6iho YZKZtISNH9B8TAwLuP/5l6CY7PXMgNA= X-Google-Smtp-Source: ABdhPJxGEGBydm1ny+pN6EWuF1JyjUuAKPGqHQ4CyFMrQT9unnThPETsqHtZCvf4GmVW3jy/OS6EEg== X-Received: by 2002:a5d:525c:: with SMTP id k28mr4850214wrc.158.1620304465048; Thu, 06 May 2021 05:34:25 -0700 (PDT) From: LemonBoy To: musl@lists.openwall.com Date: Thu, 6 May 2021 14:32:22 +0200 Message-Id: <20210506123222.76461-1-thatlemon@gmail.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [musl] [PATCH] Explicitly set .crt{i,n} alignment for ARM targets Clang's assembler behaves differently than GNU as in that it doesn't automatically set the section alignment according to the selected mode (ARM or Thumb). The problem is evident when linking together objects with a mixture of ARM and Thumb code, at link time the .init and .fini sections may end up at misaligned addresses (the required alignment is 4 as they contain ARM code) and cause problems at link or run time. --- crt/arm/crti.s | 2 ++ 1 file changed, 2 insertions(+) diff --git a/crt/arm/crti.s b/crt/arm/crti.s index 18dc1e41..29a59171 100644 --- a/crt/arm/crti.s +++ b/crt/arm/crti.s @@ -3,11 +3,13 @@ .section .init .global _init .type _init,%function +.p2align 2 _init: push {r0,lr} .section .fini .global _fini .type _fini,%function +.p2align 2 _fini: push {r0,lr} -- 2.30.2