From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-x430.google.com (mail-wr1-x430.google.com [IPv6:2a00:1450:4864:20::430]) by sourceware.org (Postfix) with ESMTPS id C22073842314 for ; Tue, 6 Dec 2022 17:52:13 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org C22073842314 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=harmstone.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-wr1-x430.google.com with SMTP id q7so24607974wrr.8 for ; Tue, 06 Dec 2022 09:52:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:in-reply-to:from:content-language :references:to:subject:user-agent:mime-version:date:message-id :sender:from:to:cc:subject:date:message-id:reply-to; bh=o9PWLhzfE/6SAVeenGBhFCRwYYvW340WzN4vQEgPyJw=; b=AFpIvJqKfTeNjySCUR27KbP7b5bYO4HJUDNYQO98dQxbHDkJCXVAQ+5+YH7il4y+Ua ZAYRRyc/qTM3fkT+tsI+PVmTlEAB944heDQHMnF0M+gCGp/cbbsDNMWdB4gNsf/hnxyk PB2otTnVMdKILFMVuv+1a5oeuOuRM7lLCj2qxn9HoFn0/Bh03Rb30CcsmyCZ4uCeUNfr upu9JYIQLDLS3scfi3DZIObe2MDjkEaVpZl721T83T4VisZsbQbuOPLCqtKrXlZkSw6m h/aS7WuuMjPVWZ2FT1ix5tdU2IzHdKXtyOUrlh4v7O4v4TGmALM7o0kGBzwY+tOj9KeI qWMQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:content-language :references:to:subject:user-agent:mime-version:date:message-id :sender:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=o9PWLhzfE/6SAVeenGBhFCRwYYvW340WzN4vQEgPyJw=; b=5dtPymmjIRir4api2zIXz54KheV2S8jgQKnkX7HsgSrwAGwGtkSniKxiOA4FQMwUBK 9D2ET90Q4o2q1gjC4REweU2fDKYthUTMGzfKGtXoiJhhS+pg4QLna7U2wudWtNFHF9VG rHy3/Q4J6OQCTY0lD3ROqakttaCgr4VKcTEabeEhM7AkzWirkoWn38GFoKkBjusG8ogj 4ATPq0ReQ4O9FCPjzgwIxegKVlCYL2qWUFg/tP0PE8N4eg2Ru4Bz0+WE2NZaO7FuXcdW jWjb2N6izEFuF2jHq9xJQ7HrimWpzwzAgFWtv4BIN4qScx/A4dR7MNOWEBXl5aOrq0np sD6Q== X-Gm-Message-State: ANoB5pnnVh/zdSEdstX5B9i1WdfTM7VfQBnxuoWBLAl4v4SUmwAmWB2P xdSyZ+1l6W+B7rczSPkYJU2n8sUlq7E= X-Google-Smtp-Source: AA0mqf7O6mvHpyXqi7dpRkLEIkYWyYobtZbaCJahA4tSEgHWV4ssoRSR7t8okmMX7w+VEKWtKKStqg== X-Received: by 2002:adf:f5c3:0:b0:242:3427:bb51 with SMTP id k3-20020adff5c3000000b002423427bb51mr15326840wrp.635.1670349132586; Tue, 06 Dec 2022 09:52:12 -0800 (PST) Received: from ?IPV6:2a02:8010:64ea:0:8eb8:7eff:fe53:9d5f? ([2a02:8010:64ea:0:8eb8:7eff:fe53:9d5f]) by smtp.googlemail.com with ESMTPSA id l9-20020a05600c2cc900b003cf9bf5208esm25521834wmc.19.2022.12.06.09.52.11 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 06 Dec 2022 09:52:12 -0800 (PST) Sender: Mark Harmstone Message-ID: Date: Tue, 6 Dec 2022 17:52:10 +0000 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.5.0 Subject: Re: [PATCH] ld: Write globals stream in PDB To: Nick Clifton , binutils@sourceware.org References: <20221129001015.21775-3-mark@harmstone.com> <20221205015347.25781-1-mark@harmstone.com> <767534e1-60ef-9f21-46ad-ebf9411ab6e9@redhat.com> Content-Language: en-US From: Mark Harmstone In-Reply-To: <767534e1-60ef-9f21-46ad-ebf9411ab6e9@redhat.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-5.1 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,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: Thanks Nick. On 6/12/22 17:07, Nick Clifton wrote: > >> +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... There is bounds-checking, it's just not immediately obvious. It ends with a CodeView record, so the first two bytes of "data" are a little- endian uint16_t of how many bytes follow. >> +/* 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. It's a htab_eq, as seen in include/hashtab.h. It's old, it looks like it was written before _Bool was standardized. > I also found that the patch no longer applies to today's sources, so if you > could rebase it that would be great. Sorry, that's because it's part of a larger set of patches, starting with "[PATCH v2] ld: Generate PDB string table" at https://sourceware.org/pipermail/binutils/2022-November/thread.html ... I seem to have confused Jan Beulich with this too. I think the easiest way is probably if you let me know which (if any) patches you're happy with, and I'll resubmit the rest as a job lot. I think this patch series is complete now. Thanks Mark