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.3 required=5.0 tests=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 2188 invoked from network); 11 Jan 2021 19:24:35 -0000 Received: from mother.openwall.net (195.42.179.200) by inbox.vuxu.org with ESMTPUTF8; 11 Jan 2021 19:24:35 -0000 Received: (qmail 20413 invoked by uid 550); 11 Jan 2021 19:24:34 -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 20393 invoked from network); 11 Jan 2021 19:24:33 -0000 Date: Mon, 11 Jan 2021 14:24:20 -0500 From: Rich Felker To: Sagar Tiwari Cc: musl@lists.openwall.com Message-ID: <20210111192420.GC23432@brightrain.aerifal.cx> References: <20210111181344.GB23432@brightrain.aerifal.cx> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Subject: Re: [musl] printf segfaults on recent musl versions On Tue, Jan 12, 2021 at 12:46:40AM +0530, Sagar Tiwari wrote: > I'm assembling a file with clang and linking it to custom compiled > musl with ld. This is the project I'm using: > > https://drive.google.com/file/d/1RiKZTf_nJUak14fz7kSXbh7egJuDthDk/view?usp=sharing In the future, please send attachments not Google Drive links. > musl 1.1.8 is the last version that works with this project. I used > clang 11.0.0 to compile both musl and this project. You can't call libc if you didn't enter the program through its entry point (or an ABI-compatible one). If you name the mn function main, link crt1.o (or the appropriate variant thereof), and drop the linker script (which may be omitting other necessary items), it should work as expected. Rich