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 3D9A13858D20 for ; Tue, 30 May 2023 14:50:58 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 3D9A13858D20 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=1685458257; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=v2SS9m34lJs3jiQv2VHO8aFv1522VJbX0yladrOzZDo=; b=NyVgaZpnzsXV8LGQsstjg+TM8Q9QFOW7oWbBaZgtHA/c8VbqbRWpmFeRMV4tOf7OvWIIHQ l1aRXn+NFrDotlP8RX8zzHWDLkpRuZfzx0DcRNV4nVve5aN3NX5dSCa9JnLpBmt4e57cmO K7iUVEfVuLm4EVGlbW3BbVGv6GLC2w8= Received: from mail-qk1-f200.google.com (mail-qk1-f200.google.com [209.85.222.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-414-aPakIhcWNva7svcbGZikDA-1; Tue, 30 May 2023 10:50:56 -0400 X-MC-Unique: aPakIhcWNva7svcbGZikDA-1 Received: by mail-qk1-f200.google.com with SMTP id af79cd13be357-75b012668d3so616792985a.0 for ; Tue, 30 May 2023 07:50:56 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685458256; x=1688050256; h=content-transfer-encoding:in-reply-to:subject:from:references:cc:to :content-language:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=v2SS9m34lJs3jiQv2VHO8aFv1522VJbX0yladrOzZDo=; b=XV62iWa3Ese3E6I25KsmjHFwQmSk4mjpuJSzWu9wIje7tG9+KiV05X2dIJgyPkrCez M5VcWqA/vglzSYEoG5a+X1A9pnjQhz5FOq6Wqzvlk41fMnvL5ZPRZ2Ur5oC2nol/W3Td RRWjgQ5YsyrAhqFOiETa+iw3qw+xx+pCrrmLTNSvVtUG/n2lvotIikddr+vqFdCmgGYV cg3Ev4W4VaY4vtAuwJu9pxzAxVYX1IQatezxfXi7bzCAo2ukBGszOZ3kwTvJ0H2NFb8a iflS12zoDqqSnAr7m35fkPwdgZ1Knsnam7L9bUjbef8WNEUxU4hYIZyG1SNvsV6H5lR3 UJ7w== X-Gm-Message-State: AC+VfDzTtTw+tFRt77ng/XQYpTG/GQBMOtXe7SEqWbZ936WD8kTyDerj fc0qbsoXxDnd8DscdT3VS4at6GZgTeObWHajXVVTkiykwWdQ1PSJVpGtUjnwnKNJUqjwVaWqACc /s17yhIsb9Dfd51DiUA== X-Received: by 2002:ad4:5c84:0:b0:626:9ef:e21d with SMTP id o4-20020ad45c84000000b0062609efe21dmr3343565qvh.10.1685458256178; Tue, 30 May 2023 07:50:56 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7v2FY31p6U6ODd1JXSmAHU0l0O8ZqFOXgVQRLC6MjoNT95kyXiXbhj2Ydq3KRF27Uu84KdZA== X-Received: by 2002:ad4:5c84:0:b0:626:9ef:e21d with SMTP id o4-20020ad45c84000000b0062609efe21dmr3343536qvh.10.1685458255829; Tue, 30 May 2023 07:50:55 -0700 (PDT) Received: from [192.168.1.7] ([80.168.198.238]) by smtp.gmail.com with ESMTPSA id l6-20020a0cd6c6000000b00626117620aasm3077869qvi.105.2023.05.30.07.50.54 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 30 May 2023 07:50:55 -0700 (PDT) Message-ID: <9d4b5371-d507-cea7-4abc-c339e7a2a75b@redhat.com> Date: Tue, 30 May 2023 15:50:53 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.10.0 To: Fangrui Song Cc: Jan Beulich , binutils@sourceware.org References: <871qj41iw5.fsf@redhat.com> From: Nick Clifton Subject: Re: RFC: Objdump: Dumping PE specific headers In-Reply-To: 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.0 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,SPF_HELO_NONE,SPF_NONE,TXREP,T_SCC_BODY_TEXT_LINE 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 Fangrui, > I wonder whether the -P header output can be made similar to the > existing output... OK, I have pushed an update which makes the output similar to that from "objdump -p", but not quite the same: $ objdump -P header tests/test-section-flags.exe tests/test-section-flags.exe: file format pei-x86-64 File Header (at offset 0): Bytes on Last Page: 144 Pages In File: 3 Relocations: 0 Size of header in paragraphs: 4 Min extra paragraphs needed: 0 Max extra paragraphs needed: 65535 Initial (relative) SS value: 0 Initial SP value: 184 Checksum: 0 Initial IP value: 0 Initial (relative) CS value: 0 File address of reloc table: 64 Overlay number: 0 OEM identifier: 0 OEM information: 0 File address of new exe header: 0x80 Stub message: !This program cannot be run in DOS mode. Image Header (at offset 0x80): Machine Number: 0x8664 - AMD64 Number of sections: 6 Time/Date: 0x646f522d - Thu May 25 13:18:53 2023 Symbol table offset: 0x001000 Number of symbols: 60 Optional header size: 0xf0 Flags: 0x0226 - EXECUTABLE,LINE NUMS STRIPPED,LARGE ADDRESS AWARE,DEBUG STRIPPED Optional 64-bit AOUT Header (at offset 0x98): Magic: 20b - PE32+ Version: 2702 Text Size: 0x200 Data Size: 0xa00 BSS Size: 0 Entry Point: 0x1000 Text Start: 0x1000 Optional PE+ Header (at offset 0xb0): Image Base: 0x40000000 Section Alignment: 0x1000 File Alignment: 0x200 Major OS Version: 4 Minor OS ersion: 0 Major Image Version: 0 Minor Image Version: 0 Major Subsystem Version: 5 Minor Subsystem Version: 2 Size Of Image: 0x7000 Size Of Headers: 0x400 CheckSum: 0xc0d7 Subsystem: 3 DllCharacteristics: 0x160 Size Of Stack Reserve: 0x200000 Size Of Stack Commit: 0x1000 Size Of Heap Reserve: 0x100000 Size Of Heap Commit: 0x1000 Loader Flags: 0 Number Of Rva and Sizes: 0x10 The update also adds support for some more PE machine numbers, and support for AOUT headers that are larger than 28 bytes. (Although I have not actually tested this feature as I could not find any sample executables use target specific AOUT headers). Cheers Nick