public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* arm-pe objdump -P
@ 2023-05-30  4:23 Alan Modra
  2023-05-30 12:53 ` Pedro Alves
  0 siblings, 1 reply; 3+ messages in thread
From: Alan Modra @ 2023-05-30  4:23 UTC (permalink / raw)
  To: binutils

arm-pe looks to be a very old PE implementation, incompatible with
current arm-wince-pe.  arm-pe has different relocations and uses
ARMMAGIC which has this comment: "I just made this up".  Well, OK, I
don't know the history but it was probably before Microsoft "just made
up" their constants for ARM windows CE.

This patch supports objdump -P for arm-pe, and another magic constant
that may appear in object files.  (I don't think binutils generates
files using ARMV7PEMAGIC aka IMAGE_FILE_MACHINE_ARMNT.)

	* od-pe.c (is_pe_object_magic): Handle IMAGE_FILE_MACHINE_ARMNT
	and ARMMAGIC.

diff --git a/binutils/od-pe.c b/binutils/od-pe.c
index 5f03bd8c3da..5a57a6e7486 100644
--- a/binutils/od-pe.c
+++ b/binutils/od-pe.c
@@ -450,6 +450,7 @@ is_pe_object_magic (unsigned short magic)
     case IMAGE_FILE_MACHINE_ALPHA:
     case IMAGE_FILE_MACHINE_ARM:
     case IMAGE_FILE_MACHINE_ARM64:
+    case IMAGE_FILE_MACHINE_ARMNT:
     case IMAGE_FILE_MACHINE_I386:
     case IMAGE_FILE_MACHINE_IA64:
     case IMAGE_FILE_MACHINE_POWERPC:
@@ -457,6 +458,7 @@ is_pe_object_magic (unsigned short magic)
     case IMAGE_FILE_MACHINE_AMD64:
       // FIXME: Add more machine numbers.
       return true;
+    case 0x0a00: /* ARMMAGIC */
     case 0x0500: /* SH_ARCH_MAGIC_BIG */
     case 0x0550: /* SH_ARCH_MAGIC_LITTLE */
     case 0x0b00: /* MCore */

-- 
Alan Modra
Australia Development Lab, IBM

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: arm-pe objdump -P
  2023-05-30  4:23 arm-pe objdump -P Alan Modra
@ 2023-05-30 12:53 ` Pedro Alves
  2023-05-31  2:02   ` Alan Modra
  0 siblings, 1 reply; 3+ messages in thread
From: Pedro Alves @ 2023-05-30 12:53 UTC (permalink / raw)
  To: Alan Modra, binutils

On 2023-05-30 5:23 a.m., Alan Modra via Binutils wrote:
> arm-pe looks to be a very old PE implementation, incompatible with
> current arm-wince-pe.  arm-pe has different relocations and uses
> ARMMAGIC which has this comment: "I just made this up".  Well, OK, I
> don't know the history but it was probably before Microsoft "just made
> up" their constants for ARM windows CE.
> 
> This patch supports objdump -P for arm-pe, and another magic constant
> that may appear in object files.  (I don't think binutils generates
> files using ARMV7PEMAGIC aka IMAGE_FILE_MACHINE_ARMNT.)
> 
> 	* od-pe.c (is_pe_object_magic): Handle IMAGE_FILE_MACHINE_ARMNT
> 	and ARMMAGIC.


IIRC, there used to be an arm-epoc-pe target for Symbian OS (which has since
been eliminated), and arm-pe ended up this weird thing that nobody really knew
what it was for.

/me googles

I found some more info in this old discussion:

  https://binutils.sourceware.narkive.com/nzAvx0GG/patch-correct-arm-rva32-value-in-pe-images-generation-for-arm-windows-ce

Note Nick's remark back then:

 "The arm-epoc-pe target was for the SymbianOS. The epoc qualifier was added
 to distinguish it from the WinCE targeted PE format version. Ideally arm-pe
 should have been dropped, but it never was."

(I haven't done anything with ARM Windows CE in over a decade, and
note GCC has dropped support for it some time ago.  GDBserver support has been
dropped too, only cross debugging support remains in GDB proper, at least, until
someone stumbles on it.)

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: arm-pe objdump -P
  2023-05-30 12:53 ` Pedro Alves
@ 2023-05-31  2:02   ` Alan Modra
  0 siblings, 0 replies; 3+ messages in thread
From: Alan Modra @ 2023-05-31  2:02 UTC (permalink / raw)
  To: Pedro Alves; +Cc: binutils

On Tue, May 30, 2023 at 01:53:02PM +0100, Pedro Alves wrote:
> IIRC, there used to be an arm-epoc-pe target for Symbian OS (which has since
> been eliminated), and arm-pe ended up this weird thing that nobody really knew
> what it was for.

Yes, arm-pe probably should be obsoleted.  It's older than
arm-epoc-pe.  When both targets existed, arm-epoc-pe was the same as
arm-pe except that the former defined ARM_COFF_BUGFIX.

-- 
Alan Modra
Australia Development Lab, IBM

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-05-31  2:02 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-30  4:23 arm-pe objdump -P Alan Modra
2023-05-30 12:53 ` Pedro Alves
2023-05-31  2:02   ` Alan Modra

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).