From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pl1-x630.google.com with SMTP id p24so9192968plw.1 for ; Sun, 04 Dec 2022 13:52:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-disposition:mime-version:message-id:subject:to:from:date :from:to:cc:subject:date:message-id:reply-to; bh=Ot42VUBWmeJtKtkSPV26thLF1sISGNyqJD1FkjL3oM0=; b=LgeFCRPJqQYLPEb+jf0L3G/j6qvz17WtPGd9Nt7I8ZFppbnRYEaC+yH71yKvMauo/M VgTl2JhmyvPGQG1iUZ6sr5TVl6UaDEgIYhDlPUuSaOAe51pQt4ySRLVovmaxdW3kKkNo Z1+Z5A20+hPYPZyi10k24mvKtAPYvFJaZ9ElpuSSnx321SMSjbgSyIvp39rzQaaY+VBe jZHL5xsK5T+uxGsd9rpbRNzVgeJwzeTVcDaQaNoNEusnGLx0KigtgKWlsCh3is3Ykce/ 51p1Z2EL9c0irY7Opjtac6ZskjN99iF4ltBudp6Bq0tLJwV+C3JqublTIa0TuvTaHWrp qY8w== 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-Google-Smtp-Source: AA0mqf7BDWdA2zoDouqS6GrZbD/ROL4bkgGBJbc588TLNtumGAVcwAfLRQwCmE9ZBoEUV8o+Glfxwg== 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 From: Alan Modra To: binutils@sourceware.org Subject: COFF compressed debug support Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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 List-Id: 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; } -- Alan Modra Australia Development Lab, IBM