From patchwork Sun Dec 4 21:51:56 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alan Modra X-Patchwork-Id: 29462 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp1951689wrr; Sun, 4 Dec 2022 13:52:10 -0800 (PST) X-Google-Smtp-Source: AA0mqf4alcQrLmdQxBGQSipJhalR4TfrxIKDVdbv8a6N7MgfG54WbP8cljWCzTjbSTFTSVN/o6zz X-Received: by 2002:a17:906:6a1d:b0:7c0:b569:8efd with SMTP id qw29-20020a1709066a1d00b007c0b5698efdmr13342015ejc.652.1670190730630; Sun, 04 Dec 2022 13:52:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670190730; cv=none; d=google.com; s=arc-20160816; b=PfPutQjf3FAkB9uNT4d5HiVrvOZGfyDaPVA9sa6tzQ8z9kir4Hg7xy5q688erLeInC 2nRxroipPzkBVqM0CCekFYmIqGQ6sLmu1tsPRc9qHC1oWb0DH1ORO1xZbHizqOmSXqf6 i767a6i4DqjIhyCcu6WU3eF2tD30OLRGpRM24Nvj/wYs1uuNZTlHNlZZgFtz6wqf88dP 1MHzCyjXy4K67+IfhZ0+lADCEkVfiec/URevONpLO0XSZq+yigejB87qidVCeQItSgVA n50FcGxOfy8MuLYz0iSxf6829T7P07KfNUvxv6UbNNBaZPs/SKf30z2Un1/ZdWrS7CUO IAUw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:from:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence :content-disposition:mime-version:message-id:subject:to:date :dmarc-filter:delivered-to:dkim-signature:dkim-filter; bh=Ot42VUBWmeJtKtkSPV26thLF1sISGNyqJD1FkjL3oM0=; b=UZmioSRB613bC/n6o7VN5dwXvwAnB+U+fzP9UvpL1/WMrSU00rKR2l9TsqFbMRUxHW R7i4L8F5QgkIm+sENciF3ZMEZE334p6PX4dHSy3V0ZXkWg1Iv9CeAhdWMxd0lOo6fVuR Rk3SACOsNgvvXWDAXUNFeXEhvCwp3+XW1NwJ0F3cHVME4S45RzxcbUbu3haaH+ui0Um+ q+juGuUHtG0O3g2iDhmkaUETK6S3uNSb9b1VmovWUmx6ET/zR+iQckZeO6kSdc7O9aHq mJQ8trhk+NxN6Z7mCvZslOUOW/I1MK10mpsVW4BBipk3otPSsExb5I1IBb9ZEGuT0L3Y Hrbw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=ZxVEK6F1; spf=pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="binutils-bounces+ouuuleilei=gmail.com@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=sourceware.org Received: from sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id dt2-20020a170907728200b007bb286800d4si10419704ejc.886.2022.12.04.13.52.10 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 04 Dec 2022 13:52:10 -0800 (PST) Received-SPF: pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=ZxVEK6F1; spf=pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="binutils-bounces+ouuuleilei=gmail.com@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id D6FBA383B78D for ; Sun, 4 Dec 2022 21:52:08 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D6FBA383B78D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1670190728; bh=Ot42VUBWmeJtKtkSPV26thLF1sISGNyqJD1FkjL3oM0=; h=Date:To:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=ZxVEK6F1mQCezL+vyJ7LtqjWeyXlXE+vnQryQlYzasTSPZfoVz2JFkLgM5O3fnaLY d9R8a2vqP5UiTZDYtZn/CfDv0ddRQiEgu6EzlVuIn+QFa354aRIdVASEGopU0pxFpB +MNY1J4e4hrNn+amhwG1H0Uu2IdjORMKFUbDa4Ys= X-Original-To: binutils@sourceware.org Delivered-To: binutils@sourceware.org Received: from mail-pl1-x630.google.com (mail-pl1-x630.google.com [IPv6:2607:f8b0:4864:20::630]) by sourceware.org (Postfix) with ESMTPS id DC22438425BE for ; Sun, 4 Dec 2022 21:52:00 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org DC22438425BE Received: by mail-pl1-x630.google.com with SMTP id p24so9192968plw.1 for ; Sun, 04 Dec 2022 13:52:00 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-disposition:mime-version:message-id:subject:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=Ot42VUBWmeJtKtkSPV26thLF1sISGNyqJD1FkjL3oM0=; b=W0AGhWfs42LO2PaPcHFYFok5NpOx4DjTrX8+IvoiJrNrKTdx39HUuSQnoTUIR78szs QcNdbbNpRe4Q22vSVfWK7qZzMF/XXubynPboS34Rjx8s7Q+8atkxjm/qscVBAomI4ovT 7SSs0ar8fBGFwkh+8eAqPmtMj/GW/DzPESNE2iUbRwm7DkftPP6O2qJLJVnKyNv7L3RT RC5gMmfTBmv3+xNilPNB2+cpHA0O7HVVmfS55qOgNddGGqtbGkl5NrtHsB3OD5Q+Tlxw UzYv0eJg+8FVgFK+wEfGZLDaPiT9XK0dyz0AVndB5OiIhdXfz46FS6luPA8oOQM25ltz 0fDQ== X-Gm-Message-State: ANoB5pmZk5Rgs5Pww9pgfJN8VpLClxEstq3iavfG0ymOgxqMBOQ9j/W9 ekyUC0II5VjlxlIGSV1RdCGfyDVq2v8= X-Received: by 2002:a17:902:e005:b0:189:c62e:ac2f with SMTP id o5-20020a170902e00500b00189c62eac2fmr8576144plo.144.1670190719395; Sun, 04 Dec 2022 13:51:59 -0800 (PST) Received: from squeak.grove.modra.org ([2406:3400:51d:8cc0:5a8:d2a4:2872:fda9]) by smtp.gmail.com with ESMTPSA id w23-20020a1709026f1700b00177f25f8ab3sm9147242plk.89.2022.12.04.13.51.58 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 04 Dec 2022 13:51:58 -0800 (PST) Received: by squeak.grove.modra.org (Postfix, from userid 1000) id 7BD9F1142D17; Mon, 5 Dec 2022 08:21:56 +1030 (ACDT) Date: Mon, 5 Dec 2022 08:21:56 +1030 To: binutils@sourceware.org Subject: COFF compressed debug support Message-ID: MIME-Version: 1.0 Content-Disposition: inline X-Spam-Status: No, score=-3035.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, 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 X-BeenThere: binutils@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Binutils mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Alan Modra via Binutils From: Alan Modra Reply-To: Alan Modra Errors-To: binutils-bounces+ouuuleilei=gmail.com@sourceware.org Sender: "Binutils" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1751321915376169185?= X-GMAIL-MSGID: =?utf-8?q?1751321915376169185?= Since commit 4bea06d73c04 COFF support for compressed debug sections has been broken due to the "flags" variable not getting SEC_HAS_CONTENTS. * coffgen.c (make_a_section_from_file): Correct section flags handling. Delete extraneous condition. Update error messages to be the same as in elf.c. diff --git a/bfd/coffgen.c b/bfd/coffgen.c index f2c71b19880..e072e168cb8 100644 --- a/bfd/coffgen.c +++ b/bfd/coffgen.c @@ -131,18 +131,18 @@ make_a_section_from_file (bfd *abfd, & flags)) result = false; - return_section->flags = flags; - /* At least on i386-coff, the line number count for a shared library section must be ignored. */ - if ((return_section->flags & SEC_COFF_SHARED_LIBRARY) != 0) + if ((flags & SEC_COFF_SHARED_LIBRARY) != 0) return_section->lineno_count = 0; if (hdr->s_nreloc != 0) - return_section->flags |= SEC_RELOC; + flags |= SEC_RELOC; /* FIXME: should this check 'hdr->s_size > 0'. */ if (hdr->s_scnptr != 0) - return_section->flags |= SEC_HAS_CONTENTS; + flags |= SEC_HAS_CONTENTS; + + return_section->flags = flags; /* Compress/decompress DWARF debug sections with names: .debug_* and .zdebug_*, after the section flags is set. */ @@ -161,7 +161,7 @@ make_a_section_from_file (bfd *abfd, if ((abfd->flags & BFD_DECOMPRESS)) action = decompress; } - else if (!bfd_is_section_compressed (abfd, return_section)) + else { /* Normal section. Check if we should compress. */ if ((abfd->flags & BFD_COMPRESS) && return_section->size != 0) @@ -177,7 +177,7 @@ make_a_section_from_file (bfd *abfd, { _bfd_error_handler /* xgettext: c-format */ - (_("%pB: unable to initialize compress status for section %s"), + (_("%pB: unable to compress section %s"), abfd, name); return false; } @@ -194,7 +194,7 @@ make_a_section_from_file (bfd *abfd, { _bfd_error_handler /* xgettext: c-format */ - (_("%pB: unable to initialize decompress status for section %s"), + (_("%pB: unable to decompress section %s"), abfd, name); return false; }