From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on gnuweeb.org X-Spam-Level: X-Spam-Status: No, score=-1.8 required=5.0 tests=ALL_TRUSTED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,NO_DNS_FOR_FROM, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from [192.168.12.80] (unknown [182.2.69.158]) by gnuweeb.org (Postfix) with ESMTPSA id DFC817E2DF; Tue, 22 Mar 2022 13:54:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gnuweeb.org; s=default; t=1647957302; bh=FNwRWV5kyah147+Fd1oNM7w3nIsC4tpI18bVQxUMzMY=; h=Date:Subject:From:To:Cc:References:In-Reply-To:From; b=k1WSchwHbTrWSBLb+Wde6AnOkCuyNqJItIJxQBp87k5SW1+4PeRmj7CXTVB4jMiuO iIb0CePwQOQjNwvnirqYeXNutxvJD2Cs88Dmycl6Wa0udgfjvuEbxxyctpiZJ/FdFt opmT0wrLFYP5DTPKUz4CFrs2mEy6FsIf42H3/90f4u8lwsXMCGO3lFxtdvaCQFIq+b RzLQINUqCUFmF+1HCgpP013KlmfSAzKp8iCQrcEKxy8ZKXBDtByRAY3hlA6NORCkwq md7kuXQRQZhRI+5pMFAL6/hQAUUioM+Zmqg5UORibCIY7XavLfOKhHNxu50UqzzueI +DFxrMv/mXrmA== Message-ID: <98304cd4-a443-5e5e-9764-654ecd1d458b@gnuweeb.org> Date: Tue, 22 Mar 2022 20:54:55 +0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 Subject: Re: [RFC PATCH v2 3/8] tools/nolibc: i386: Implement syscall with 6 arguments Content-Language: en-US From: Ammar Faizi To: Willy Tarreau , David Laight Cc: "Paul E. McKenney" , Alviro Iskandar Setiawan , Nugraha , Linux Kernel Mailing List , GNU/Weeb Mailing List , "x86@kernel.org" , "llvm@lists.linux.dev" References: <20220322102115.186179-1-ammarfaizi2@gnuweeb.org> <20220322102115.186179-4-ammarfaizi2@gnuweeb.org> <8653f6784a9b4272a59a75a530663567@AcuMS.aculab.com> <20220322121338.GD10306@1wt.eu> <81569a1c-a6d3-ceb2-a1f1-f229a024d684@gnuweeb.org> <20220322133413.GG10306@1wt.eu> <58cb5455-d065-b508-b328-20b57c3a67a7@gnuweeb.org> <3b8984ecfbcd4c93aeb468d01728cd74@AcuMS.aculab.com> <20220322134100.GH10306@1wt.eu> <9cfcb296-9dfe-aef1-4209-20a3a95c50ba@gnuweeb.org> In-Reply-To: <9cfcb296-9dfe-aef1-4209-20a3a95c50ba@gnuweeb.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: Willy, something goes wrong here... ammarfaizi2@integral2:~/work/linux.work/tools/include/nolibc$ taskset -c 0 gcc -ffreestanding -nostdlib -nostartfiles test.c -o test -lgcc /usr/bin/ld: /tmp/ccHiYiks.o: warning: relocation against `environ' in read-only section `.text' /usr/bin/ld: /tmp/ccHiYiks.o: in function `getenv': test.c:(.text+0x1f76): undefined reference to `environ' /usr/bin/ld: test.c:(.text+0x1fc3): undefined reference to `environ' /usr/bin/ld: test.c:(.text+0x1ffc): undefined reference to `environ' /usr/bin/ld: test.c:(.text+0x2021): undefined reference to `environ' /usr/bin/ld: test.c:(.text+0x2049): undefined reference to `environ' /usr/bin/ld: warning: creating DT_TEXTREL in a PIE collect2: error: ld returned 1 exit status ammarfaizi2@integral2:~/work/linux.work/tools/include/nolibc$ I suspect it's caused by commit: commit c970abe796019b3d576fd154a54b94efb35c02b1 Author: Willy Tarreau Date: Mon Mar 21 18:33:08 2022 +0100 tools/nolibc/stdlib: add a simple getenv() implementation This implementation relies on an extern definition of the environ variable, that the caller must declare and initialize from envp. Signed-off-by: Willy Tarreau Signed-off-by: Paul E. McKenney I will take a look deeper on this... -- Ammar Faizi