From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17489 invoked by alias); 4 Jul 2011 19:49:40 -0000 Received: (qmail 17481 invoked by uid 22791); 4 Jul 2011 19:49:39 -0000 X-SWARE-Spam-Status: No, hits=-2.2 required=5.0 tests=AWL,BAYES_00,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from e24smtp03.br.ibm.com (HELO e24smtp03.br.ibm.com) (32.104.18.24) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 04 Jul 2011 19:49:26 +0000 Received: from /spool/local by e24smtp03.br.ibm.com with XMail ESMTP for from ; Mon, 4 Jul 2011 16:49:20 -0300 Received: from d24relay01.br.ibm.com ([9.8.31.16]) by e24smtp03.br.ibm.com ([10.172.0.139]) with XMail ESMTP; Mon, 4 Jul 2011 16:49:18 -0300 Received: from d24av03.br.ibm.com (d24av03.br.ibm.com [9.8.31.95]) by d24relay01.br.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id p64JjpAH4395158 for ; Mon, 4 Jul 2011 16:45:51 -0300 Received: from d24av03.br.ibm.com (loopback [127.0.0.1]) by d24av03.br.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id p64JnNjJ001997 for ; Mon, 4 Jul 2011 16:49:23 -0300 Received: from [9.8.1.40] ([9.8.1.40]) by d24av03.br.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id p64JnNgN001958 for ; Mon, 4 Jul 2011 16:49:23 -0300 Subject: [RFA] Document lm_addr_check. From: Thiago Jung Bauermann To: gdb-patches ml Content-Type: text/plain; charset="UTF-8" Date: Mon, 04 Jul 2011 19:51:00 -0000 Message-ID: <1309808956.4471.16.camel@hactar> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit x-cbid: 11070419-9254-0000-0000-000005C2303F X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2011-07/txt/msg00120.txt.bz2 Hi, A long time ago I had to understand lm_addr_check and as a result I wrote the comment below. I just ran across this forgotten patch. Could someone more familiar with the code confirm that the comment is correct? -- []'s Thiago Jung Bauermann IBM Linux Technology Center 2011-07-04 Thiago Jung Bauermann * solib-svr4.c: (lm_addr_check): Document function. diff --git a/gdb/solib-svr4.c b/gdb/solib-svr4.c index d92a83c..e05b585 100644 --- a/gdb/solib-svr4.c +++ b/gdb/solib-svr4.c @@ -170,6 +170,16 @@ lm_dynamic_from_link_map (struct so_list *so) ptr_type); } +/* Returns the load address of the given shared object. + + The function also checks if the address of the .dynamic section as + calculated from the load address plus the section address in the + shared object file matches the actual .dynamic address as given by + the inferior's link map. + + If they don't match, it tries to determine if the difference is due + to prelink and adjusts the load address accordingly, warning the user. */ + static CORE_ADDR lm_addr_check (struct so_list *so, bfd *abfd) {