From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.0 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL autolearn=ham autolearn_force=no version=3.4.4 Received: from second.openwall.net (second.openwall.net [193.110.157.125]) by inbox.vuxu.org (Postfix) with SMTP id 5696D20251 for ; Fri, 29 Mar 2024 02:48:18 +0100 (CET) Received: (qmail 10221 invoked by uid 550); 29 Mar 2024 01:43:24 -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 10180 invoked from network); 29 Mar 2024 01:43:23 -0000 Date: Thu, 28 Mar 2024 21:48:24 -0400 From: Rich Felker To: Max Filippov Cc: musl@lists.openwall.com Message-ID: <20240329014824.GG32430@brightrain.aerifal.cx> References: <20240328200319.4016902-1-jcmvbkbc@gmail.com> <20240328230116.GM4163@brightrain.aerifal.cx> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Subject: Re: [musl] [RFC v2 0/2] xtensa FDPIC port On Thu, Mar 28, 2024 at 05:48:50PM -0700, Max Filippov wrote: > On Thu, Mar 28, 2024 at 4:00 PM Rich Felker wrote: > > On Thu, Mar 28, 2024 at 01:03:17PM -0700, Max Filippov wrote: > > > functional/dlopen fails with the > > > src/functional/dlopen.c:39: dlsym main failed: (null) > > > There's no failure in the dlsym call, but the pointers don't match. > > > > Is this something related to canonical function descriptors? Is it > > musl's fault or a bug in the tooling? I suspect the latter. > > Yes, dlsym() returns the pointer into def.dso->funcdescs, > but (void *)main returns the pointer to the canonical function > descriptor. I understand that the linker must use the > R_XTENSA_FUNCDESC relocation for the locally defined > global symbol instead of the .rofixup entries. If the xtensa FDPIC ABI is going to be that the linker makes canonical function descriptors, I think that's workable, but the dynamic linker would need a way to find and usee them. I'm not sure how that would work. The simple (but probably less efficient) way is to copy what SH did and have the dynamic linker always be responsible for them (load descriptor address from GOT). Rich