From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mout-p-202.mailbox.org (mout-p-202.mailbox.org [IPv6:2001:67c:2050::465:202]) by sourceware.org (Postfix) with ESMTPS id 555C03858004 for ; Thu, 29 Oct 2020 08:23:39 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 555C03858004 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=maringuu.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=personal@maringuu.de Received: from smtp1.mailbox.org (smtp1.mailbox.org [80.241.60.240]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-202.mailbox.org (Postfix) with ESMTPS id 4CMJP60lBbzQlRH for ; Thu, 29 Oct 2020 09:23:38 +0100 (CET) X-Virus-Scanned: amavisd-new at heinlein-support.de Received: from smtp1.mailbox.org ([80.241.60.240]) by hefe.heinlein-support.de (hefe.heinlein-support.de [91.198.250.172]) (amavisd-new, port 10030) with ESMTP id SoYteKfiUfYQ for ; Thu, 29 Oct 2020 09:23:35 +0100 (CET) Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Subject: [Question] Is there a way to specify an offset to the loaded symbols? From: "Marten Ringwelski" To: Date: Thu, 29 Oct 2020 09:13:58 +0100 Message-Id: X-MBO-SPAM-Probability: * X-Rspamd-Score: 0.04 / 15.00 / 15.00 X-Rspamd-Queue-Id: 2022917EC X-Rspamd-UID: 10ad0a X-Spam-Status: No, score=-3.4 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS, KAM_LAZY_DOMAIN_SECURITY, NO_DNS_FOR_FROM, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gdb@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Oct 2020 08:23:41 -0000 Hello, for some reason that is not important here I need to debug a binary that is= executed by calling the linker manually. In my case I do `/lib/ld-musl-x86_64.so.1 binary`. The problem with this is that gdb now obviously thinks that I want to debug= `/lib/ld-musl-x86_64.so.1`. This is not the case. Loading the symbols from `binary` does not help since the the linker loads = the process into memory and the jumps to its main. In other words I have the symbols for the binary to be debugged but the bin= ary is loaded into memory with an offset so the symbols are offseted. Is there any way to get this working? Thank you! Marten Ringwelski