From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pg1-x52b.google.com (mail-pg1-x52b.google.com [IPv6:2607:f8b0:4864:20::52b]) by sourceware.org (Postfix) with ESMTPS id 722BF3858D3C for ; Mon, 22 Nov 2021 00:15:34 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 722BF3858D3C Received: by mail-pg1-x52b.google.com with SMTP id f65so4118802pgc.0 for ; Sun, 21 Nov 2021 16:15:34 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition; bh=SGmFtoe6f++CVdJIc+ImMDKC30YoM6e6Pz74tpdCLuk=; b=Mt8Dr4Y4QbR/SrkXpuxdj02o5kwztvUQMc/pP3KuLgVKNJ0TZkC5IKOp7wpulrwvUi FX4Xw+PwGVYh9mawvGucBMz5wo0iZZ0lzWdfsqmJi4Ipc3zpSBe/mSwH8SDYBIpAY1Fe y6ou+sWkL6bxeH4e4fANrGoo0uVpyA+k7k6imhStH8ey2rJmhXG1i+ep9dhp/pc0U0a8 1QeYyNAaUgM3CNWQrFLPVwnkOjn6KS1M1tg4YjNgx2xW/qlJKLPnmmMPmOFgCTLAvxqV VxIo1uaZoIRSkly8HmbcLqDw52x/rsoyLkrB8DvjlkhXiJ2pCes7flo9MNS3hgMevvQU 9HOA== X-Gm-Message-State: AOAM5323Hu5aC0EJiqsA70ityTIh112hgw7CKAcQfE2fND39RwQBaAOR hYHmybzZcPMDEXC825d54nev82Q9TIA= X-Google-Smtp-Source: ABdhPJwASL9K9Jyvjk7miO2gFVWF+mLqx5rCZb9CsJKAUFdNvRZ9q5nvG7gqh7fVF4FruUoKmpdcEA== X-Received: by 2002:a05:6a00:883:b0:4a4:b11e:1cc4 with SMTP id q3-20020a056a00088300b004a4b11e1cc4mr19665834pfj.60.1637540133684; Sun, 21 Nov 2021 16:15:33 -0800 (PST) Received: from squeak.grove.modra.org (158.106.96.58.static.exetel.com.au. [58.96.106.158]) by smtp.gmail.com with ESMTPSA id y10sm5446688pfl.21.2021.11.21.16.15.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 21 Nov 2021 16:15:33 -0800 (PST) Received: by squeak.grove.modra.org (Postfix, from userid 1000) id 6F99F1141219; Mon, 22 Nov 2021 10:45:30 +1030 (ACDT) Date: Mon, 22 Nov 2021 10:45:30 +1030 From: Alan Modra To: binutils@sourceware.org Subject: PR28029, debuginfod tests Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Spam-Status: No, score=-3038.5 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.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) 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-List-Received-Date: Mon, 22 Nov 2021 00:15:36 -0000 binutils/NEWS says of the change in --process-links semantics: If other debug section display options are also enabled (eg --debug-dump=info) then the contents of matching sections in both the main file and the separate debuginfo file *will* be displayed. This is because in most cases the debug section will only be present in one of the files. Implying that debug info is dumped without --process-links. Indeed that appears to be the case for readelf. This does the same for objdump. I'm not entirely happy with the patch as-is; I think .eh_frame and any other section in dwarf.c:debug_displays that is *not* stripped by objcopy --strip-debug should not have anything in the --only-keep-debug file displayed. I'm not going to apply this patch immediately as I'm not entirely sure on the intended semantics of --process-links, and Nick, you may already have a better patch in the works. PR 28029 * objdump.c (dump_bfd): Do not exit early when !is_mainfile && !processlinks, instead just exclude non-debug output. diff --git a/binutils/objdump.c b/binutils/objdump.c index 1811e70df93..7e4d2018c71 100644 --- a/binutils/objdump.c +++ b/binutils/objdump.c @@ -5053,23 +5053,23 @@ dump_bfd (bfd *abfd, bool is_mainfile) bfd_map_over_sections (abfd, adjust_addresses, &has_reloc); } - if (! is_mainfile && ! process_links) - return; - - if (! dump_debugging_tags && ! suppress_bfd_header) - printf (_("\n%s: file format %s\n"), - sanitize_string (bfd_get_filename (abfd)), - abfd->xvec->name); - if (dump_ar_hdrs) - print_arelt_descr (stdout, abfd, true, false); - if (dump_file_header) - dump_bfd_header (abfd); - if (dump_private_headers) - dump_bfd_private_header (abfd); - if (dump_private_options != NULL) - dump_target_specific (abfd); - if (! dump_debugging_tags && ! suppress_bfd_header) - putchar ('\n'); + if (is_mainfile || process_links) + { + if (! dump_debugging_tags && ! suppress_bfd_header) + printf (_("\n%s: file format %s\n"), + sanitize_string (bfd_get_filename (abfd)), + abfd->xvec->name); + if (dump_ar_hdrs) + print_arelt_descr (stdout, abfd, true, false); + if (dump_file_header) + dump_bfd_header (abfd); + if (dump_private_headers) + dump_bfd_private_header (abfd); + if (dump_private_options != NULL) + dump_target_specific (abfd); + if (! dump_debugging_tags && ! suppress_bfd_header) + putchar ('\n'); + } if (dump_symtab || dump_reloc_info @@ -5112,39 +5112,46 @@ dump_bfd (bfd *abfd, bool is_mainfile) } } - if (dump_section_headers) - dump_headers (abfd); + if (is_mainfile || process_links) + { + if (dump_section_headers) + dump_headers (abfd); - if (dump_dynamic_symtab || dump_dynamic_reloc_info - || (disassemble && bfd_get_dynamic_symtab_upper_bound (abfd) > 0)) - dynsyms = slurp_dynamic_symtab (abfd); + if (dump_dynamic_symtab || dump_dynamic_reloc_info + || (disassemble && bfd_get_dynamic_symtab_upper_bound (abfd) > 0)) + dynsyms = slurp_dynamic_symtab (abfd); - if (disassemble) - { - synthcount = bfd_get_synthetic_symtab (abfd, symcount, syms, - dynsymcount, dynsyms, &synthsyms); - if (synthcount < 0) - synthcount = 0; - } + if (disassemble) + { + synthcount = bfd_get_synthetic_symtab (abfd, symcount, syms, + dynsymcount, dynsyms, + &synthsyms); + if (synthcount < 0) + synthcount = 0; + } - if (dump_symtab) - dump_symbols (abfd, false); - if (dump_dynamic_symtab) - dump_symbols (abfd, true); + if (dump_symtab) + dump_symbols (abfd, false); + if (dump_dynamic_symtab) + dump_symbols (abfd, true); + } if (dump_dwarf_section_info) dump_dwarf (abfd); - if (dump_ctf_section_info) - dump_ctf (abfd, dump_ctf_section_name, dump_ctf_parent_name); - if (dump_stab_section_info) - dump_stabs (abfd); - if (dump_reloc_info && ! disassemble) - dump_relocs (abfd); - if (dump_dynamic_reloc_info && ! disassemble) - dump_dynamic_relocs (abfd); - if (dump_section_contents) - dump_data (abfd); - if (disassemble) - disassemble_data (abfd); + if (is_mainfile || process_links) + { + if (dump_ctf_section_info) + dump_ctf (abfd, dump_ctf_section_name, dump_ctf_parent_name); + if (dump_stab_section_info) + dump_stabs (abfd); + if (dump_reloc_info && ! disassemble) + dump_relocs (abfd); + if (dump_dynamic_reloc_info && ! disassemble) + dump_dynamic_relocs (abfd); + if (dump_section_contents) + dump_data (abfd); + if (disassemble) + disassemble_data (abfd); + } if (dump_debugging) { -- Alan Modra Australia Development Lab, IBM