From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pj1-x102b.google.com (mail-pj1-x102b.google.com [IPv6:2607:f8b0:4864:20::102b]) by sourceware.org (Postfix) with ESMTPS id 433A73857C67; Sun, 15 Aug 2021 13:11:39 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 433A73857C67 Received: by mail-pj1-x102b.google.com with SMTP id j1so22385815pjv.3; Sun, 15 Aug 2021 06:11:39 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=2njx3+qNKB+/SGRhQ+gLSe/NLpHD2gApRI7BLymPb4c=; b=ldjCyKzJ62P42HzYqTyN24D0CzMx/r6l+VnM75Wg60/qqGokgJLp7DmGp921uDHSmf Bo0mTocQfN1/PVbT1gYc7EUTl9wXX6LajmslttfBOsutPVHhkoxlDl/dYKQ6jv/9yQRt aOxriAsLA7GIuqu2+7/7Qkd0gCZzgBuWDOqhXVyg7lGBvsKRZJrkxVGDJS6yrRa51kVE vFYMexLzC8IyRT+eTu5WSXGDvpHFxrbpG3TDOWre1MBQoncVIphhvVLlY0Vdr2DzBv5S jsAZuT9wyfL50xFY65kBvM/pq7nzI9tmi49Z56vc2IrM0OEaaZ/vvIp4rqXC1VCMCf/e 9O5A== X-Gm-Message-State: AOAM533q8GkeDlghauiTYAtBl70ECZRC9RYdwpbCNFlaSBw7cVr4eKjl K+F7x3bHU5dV7stS+y+jrdcs77USY5NeEnXQOsah86gO3nM= X-Google-Smtp-Source: ABdhPJywxO7/xkLEZzW5Q7qzUQ/BTP7ZhKEBY644NiK7PGBJG6VAqNfOVYSvis5bvPuh2BjkViGRGFEFZNtg+1VPAqg= X-Received: by 2002:a17:90b:14c3:: with SMTP id jz3mr5535087pjb.153.1629033098354; Sun, 15 Aug 2021 06:11:38 -0700 (PDT) MIME-Version: 1.0 References: <20210815002338.2779683-1-hjl.tools@gmail.com> <87a6lix6qe.fsf@mid.deneb.enyo.de> In-Reply-To: From: "H.J. Lu" Date: Sun, 15 Aug 2021 06:11:02 -0700 Message-ID: Subject: Re: [PATCH] elf: Add -z [dt-debugsz|nodt-debugsz] to emit DT_DEBUGSZ To: Florian Weimer Cc: "H.J. Lu via Gdb-patches" , Binutils , GNU C Library Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-3024.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Aug 2021 13:11:47 -0000 On Sun, Aug 15, 2021 at 5:50 AM H.J. Lu wrote: > > On Sun, Aug 15, 2021 at 4:55 AM Florian Weimer wrote: > > > > * H. J. Lu via Gdb-patches: > > > > > Add -z [dt-debugsz|nodt-debugsz] to emit a DT_DEBUGSZ dynamic tag so > > > that the dynamic linker can set its value to the size of the structure > > > of debugger interface, whose address is stored in the DT_DEBUG dynamic > > > tag, used by the dynamic linker. > > > > I do not think this is necessary. We can increase the version number > > in the existing DT_DEBUG structure. > > Some debuggers expect r_version == 1. GDB has if (linux_read_memory (priv->r_debug + lmo->r_version_offset, (unsigned char *) &r_version, sizeof (r_version)) != 0 || r_version != 1) { warning ("unexpected r_debug version %d", r_version); } else if (read_one_ptr (priv->r_debug + lmo->r_map_offset, &lm_addr, ptr_size) != 0) { warning ("unable to read r_map from 0x%lx", (long) priv->r_debug + lmo->r_map_offset); } -- H.J.