From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14392 invoked by alias); 20 Aug 2013 19:39:23 -0000 Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org Received: (qmail 14383 invoked by uid 89); 20 Aug 2013 19:39:23 -0000 X-Spam-SWARE-Status: No, score=-7.0 required=5.0 tests=AWL,BAYES_00,RCVD_IN_HOSTKARMA_W,RCVD_IN_HOSTKARMA_WL,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Tue, 20 Aug 2013 19:39:22 +0000 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r7KJdLxo014722 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 20 Aug 2013 15:39:21 -0400 Received: from barimba (ovpn-113-142.phx2.redhat.com [10.3.113.142]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id r7KJdKmf015752 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Tue, 20 Aug 2013 15:39:20 -0400 From: Tom Tromey To: GDB Development Subject: solib-sunos.c is broken Date: Tue, 20 Aug 2013 19:39:00 -0000 Message-ID: <87haekgniv.fsf@fleche.redhat.com> MIME-Version: 1.0 Content-Type: text/plain X-SW-Source: 2013-08/txt/msg00077.txt.bz2 While working on a global change to minimal symbols, I stumbled across solib-sunos.c. It is broken. I think it won't even compile right now. Anyway, I thought I'd send a note detailing its various problems. If someone wants to fix them up, that would be great. I don't have access to any of the affected systems. It's been broken since at least August of last year. So, it is apparently not heavily used, at least not by folks involved with this community (it is referenced by the various a.out *BSD ports, so perhaps it is patched up in some BSD tree, I don't know). Here's the bugs I can see from looking: * This code is set up to only be compiled for a.out hosts. That is, it is treated as though it is part of the "native" target. I think conceptually though this code is really not host-dependent, but instead should be part of the tdep layer. Fixing this would at least enable folks like me to avoid breaking the build... similar to the machoread and somread changes earlier this year. * allocate_rt_common_objfile allocates an objfile "by hand" and populates it. This violate module boundaries; and in this case the code has long since bit-rotted. It doesn't initialize all the fields properly -- e.g., the per-bfd object is missing, "name" is allocated with xstrdup. Some fields it does initialize have been moved to the per-bfd object (which is why it won't compile...). The fix is to change this code to use the exported objfile API. * solib_add_common_symbols leaves the minimal-symbol-discarding cleanup dangling. Probably not a severe issue, but best avoided. * rt_common_objfile is a global, but in the new style it should be per-progspace. I'm happy to file a bug with this info, but my sense is that nobody looks at a.out bug reports. Tom