From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id A313E3858D35; Wed, 18 Jan 2023 00:48:46 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A313E3858D35 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1674002926; bh=BKFhKV7poi/1cWY12jUH14xtGYYl8m3Qcjed2VKj/m8=; h=From:To:Subject:Date:In-Reply-To:References:From; b=Hv0UkwXh9hatryAbLgVFJ4ywGMtI6nbLZ9fDv3gfcy6hO61S+FhWrrwyUFRLTfufA 7/Wlro4w38HdxlLAyF5kvB29q56L8+kArXrLa5ZDeY0LPTR4IBSjHiEROK/DOijmWF bASTMQR9ZxNNlQU4O3JjRV5pGfSPWR/KDXH81cTs= From: "rui314 at gmail dot com" To: gdb-prs@sourceware.org Subject: [Bug gdb/30008] gdb fails to get line numbers with gold/mold with --gdb-index Date: Wed, 18 Jan 2023 00:48:46 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: gdb X-Bugzilla-Version: HEAD X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: rui314 at gmail dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://sourceware.org/bugzilla/show_bug.cgi?id=3D30008 --- Comment #2 from Rui Ueyama --- I'm using "GNU gold (GNU Binutils for Ubuntu 2.38) 1.16" on Ubuntu 22.04. You may want to apply the following patch to ensure you are using gold with `--gdb-index`. ``` diff --git a/CMakeLists.txt b/CMakeLists.txt index 3e0ae9ed..091835c5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -55,6 +55,8 @@ if(MOLD_USE_MOLD) add_link_options(-fuse-ld=3Dmold -Wl,--gdb-index) endif() +add_link_options(-fuse-ld=3Dgold -Wl,--gdb-index) + add_executable(mold) target_compile_features(mold PRIVATE cxx_std_20) target_link_libraries(mold PRIVATE ${CMAKE_DL_LIBS}) ``` With this patch, I can reproduce the issue with the following commands: $ git clone git@github.com:rui314/mold.git $ cd mold $ patch -p1 < patch.diff $ mkdir build; cd build $ cmake -DCMAKE_BUILD_TYPE=3DDebug -DCMAKE_CXX_COMPILER=3Dclang++-14 .. $ cmake --build . $ gdb ./mold -nx -batch -ex 'b parse_nonpositional_args' -ex 'run --no-fork --no-threads' -ex bt -ex c -ex quit --=20 You are receiving this mail because: You are on the CC list for the bug.=