From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id 5DFE7383FD76 for ; Tue, 6 Dec 2022 17:07:36 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 5DFE7383FD76 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1670346456; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=O5tIckN6Tm2ta/08YJuI8CNuGJSqFvRzsm+uHIUp64g=; b=hFgylCqJ1rdzguMSIwOC+fpMSntMndE4CI7ssgoA3MsbCWoEYS8VXDETfr4nRxAl3IgLZ5 jFkz6WQnCLqr2txeuBpRMmaCI1A2dPMCsbtOAmA2x7cCo2m6Nmav6Z7M52qe3xhcWjwXiV vHQO/Uvq8vu4SJbKgiW/uT2v1WfM4GI= Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-490-Vtf85uM3O5aCTSnoxB5UHg-1; Tue, 06 Dec 2022 12:07:35 -0500 X-MC-Unique: Vtf85uM3O5aCTSnoxB5UHg-1 Received: by mail-wm1-f72.google.com with SMTP id c126-20020a1c3584000000b003cfffcf7c1aso10217671wma.0 for ; Tue, 06 Dec 2022 09:07:35 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:subject:from:references:to :content-language:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=O5tIckN6Tm2ta/08YJuI8CNuGJSqFvRzsm+uHIUp64g=; b=OHMPrQt7HwixmsK99EiTJ642E2tlYu6+izMWbZUwP7VTlqAQCj8VC594LDuZFEWuKT UjkDhgjWT87InncIDwmtmx+Zq+CBWeiX22uGMEDjmBngr/VRq9ddbTbDrfof9d7YSMnv gQUeawG751udhc5HbDKuGeP9Nhe17yBAwSmclFWFvNbEb5mLfVHVD8d4jEA61alFCA1m PMbMthgv58U1yibMbu0Wxc8c1sMavZMfZIfAKcZX2k5AYofoSdJULQh3inPFL+PVnR7E ZQ0ZOxBkSwconhT9ENIGzf7KaEzJdCaPx+ejqKkWux3sW3xst+X9EGjDsP7yhsOPGhsW sUPA== X-Gm-Message-State: ANoB5plQqtMLIAIpiTxxFJmVUtFU/05HIRCgDJGHFQzzne3sCEikduXr RX+aRMfyXMSYt2HLMMEu8fJncuboVPKiZog//J7c1QVKIs96rH6o5P14iFstFXtRjpxTK7F4Ttv ELai7ennhdRdgMn+m5w== X-Received: by 2002:a05:6000:90f:b0:241:cfbc:95a4 with SMTP id bz15-20020a056000090f00b00241cfbc95a4mr45051439wrb.453.1670346453570; Tue, 06 Dec 2022 09:07:33 -0800 (PST) X-Google-Smtp-Source: AA0mqf7sCZykyZ1XX3b3/gj7togL2bMG0rGrnrt9771DNF/oQwf6Vfrkz6bwhA2qXSTQXRSRSUTPqA== X-Received: by 2002:a05:6000:90f:b0:241:cfbc:95a4 with SMTP id bz15-20020a056000090f00b00241cfbc95a4mr45051426wrb.453.1670346453327; Tue, 06 Dec 2022 09:07:33 -0800 (PST) Received: from [192.168.1.18] ([79.123.75.206]) by smtp.gmail.com with ESMTPSA id v14-20020a05600c444e00b003a1980d55c4sm27142411wmn.47.2022.12.06.09.07.32 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 06 Dec 2022 09:07:32 -0800 (PST) Message-ID: <767534e1-60ef-9f21-46ad-ebf9411ab6e9@redhat.com> Date: Tue, 6 Dec 2022 17:07:32 +0000 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.5.1 To: Mark Harmstone , binutils@sourceware.org References: <20221129001015.21775-3-mark@harmstone.com> <20221205015347.25781-1-mark@harmstone.com> From: Nick Clifton Subject: Re: [PATCH] ld: Write globals stream in PDB In-Reply-To: <20221205015347.25781-1-mark@harmstone.com> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-GB Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3.2 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Hi Mark, > Parses the .debug$S sections of object files for DEBUG_S_SYMBOLS > subsections, creating a globals stream based on the records we find. > These also get copied into the module stream for each object file. A few comments on the patch ... > +struct global > +{ > + struct global *next; > + uint32_t offset; > + uint32_t hash; > + uint32_t refcount; > + unsigned int index; > + uint8_t data[]; > +}; I dislike variable length arrays, espcially ones that do not have an associated length field for bounds checking. I understand the need, but I would definitely advise being more paranoid... > +/* Compare an entry in the string table with a string. */ > +static int > +eq_string_table_entry (const void *a, const void *b) Is this really an "int" function ? It looks like it returns a bool to me. > +/* Remap a type reference within a CodeView symbol. */ > +static bool remap_symbol_type (void *data, struct type_entry **map, > + uint32_t num_types) Formatting - please put the function name at the start of the next line. > + switch (type) > + { > + case S_GPROC32: > + case S_LPROC32: > + scope_level++; > + break; > + > + case S_END: > + case S_PROC_ID_END: > + scope_level--; > + > + if (scope_level == 0) > + return data; > + > + break; > + } Please can you add a default case for this switch. Probably with an error result of some kind, unless other types are expected and can be ignored. (There are several other switch statements like this too). I also found that the patch no longer applies to today's sources, so if you could rebase it that would be great. Cheers Nick