From owner-freebsd-bugs Fri Jul 19 14:30:06 1996 Return-Path: owner-bugs Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id OAA20606 for bugs-outgoing; Fri, 19 Jul 1996 14:30:06 -0700 (PDT) Received: (from gnats@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id OAA20599; Fri, 19 Jul 1996 14:30:03 -0700 (PDT) Resent-Date: Fri, 19 Jul 1996 14:30:03 -0700 (PDT) Resent-Message-Id: <199607192130.OAA20599@freefall.freebsd.org> Resent-From: gnats (GNATS Management) Resent-To: freebsd-bugs Resent-Reply-To: FreeBSD-gnats@freefall.FreeBSD.org, tody@noao.edu Received: from noao.edu (noao.edu [140.252.1.54]) by freefall.freebsd.org (8.7.5/8.7.3) with ESMTP id OAA20254 for ; Fri, 19 Jul 1996 14:22:58 -0700 (PDT) Received: from tucana.tuc.noao.edu (tucana.tuc.noao.edu [140.252.1.1]) by noao.edu (8.7.5/8.7.3/SAG-15Apr96) with SMTP id OAA21728 for ; Fri, 19 Jul 1996 14:22:52 -0700 (MST) Received: from lepus.tuc.noao.edu by tucana.tuc.noao.edu (4.1/SAG.sat.14) id AA00602; Fri, 19 Jul 96 14:22:52 MST; for FreeBSD-gnats-submit@freebsd.org Received: (from tody@localhost) by lepus.tuc.noao.edu (8.7.5/8.7.3) id OAA06363; Fri, 19 Jul 1996 14:22:44 -0700 (MST) Message-Id: <199607192122.OAA06363@lepus.tuc.noao.edu> Date: Fri, 19 Jul 1996 14:22:44 -0700 (MST) From: tody@noao.edu Reply-To: tody@noao.edu To: FreeBSD-gnats-submit@freebsd.org X-Send-Pr-Version: 3.2 Subject: gnu/1407: Problem with ld and common sizes Sender: owner-bugs@freebsd.org X-Loop: FreeBSD.org Precedence: bulk >Number: 1407 >Category: gnu >Synopsis: ld computes wrong size of common (global data) >Confidential: no >Severity: serious >Priority: low >Responsible: freebsd-bugs >State: open >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Fri Jul 19 14:30:01 PDT 1996 >Last-Modified: >Originator: Doug Tody >Organization: Doug Tody National Optical Astronomy Observatories IRAF project tody@noao.edu P.O. Box 26732, Tucson, Arizona, 85726 http://iraf.noao.edu >Release: FreeBSD 2.2-960612-SNAP i386 >Environment: FreeBSD lepus 2.2-960612-SNAP FreeBSD 2.2-960612-SNAP #0: Tue Jul 16 14:45:25 MST 1996 tody@lepus:/usr/src/sys/compile/LEPUS i386 >Description: When linking an executable and the same common (global structure) exists in both the program and a library with different sizes, the smaller of the two sizes is erroneously used. The larger size should be used. >How-To-Repeat: Requires some test code to repeat. >Fix: I just looked at the LD code but the following appears to be the problem. See line 531 of gnu/usr.bin/ld/lib.c: if (iscommon && p->n_value < sp->common_size) sp->common_size = p->n_value; In words, "if the value we are looking at is less than the currently recorded size of the common use the new (smaller) value". Should read if (iscommon && sp->common_size < p->n_value) sp->common_size = p->n_value; as is done everywhere else in the code. (I didn't look into it further or test the changes but whoever is responsible for LD ought to be able to verify this visually). Doug Tody National Optical Astronomy Observatories IRAF project tody@noao.edu P.O. Box 26732, Tucson, Arizona, 85726 http://iraf.noao.edu >Audit-Trail: >Unformatted: