This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: arm-wince-pe objdump does not disassemble .text section
- From: Nick Clifton <nickc at redhat dot com>
- To: <Dmitry dot Semyonov at oktet dot ru>
- Cc: <binutils at sources dot redhat dot com>
- Date: Tue, 11 Nov 2003 10:49:13 +0000
- Subject: Re: arm-wince-pe objdump does not disassemble .text section
- References: <Pine.LNX.4.33.0311051813140.11699-100000@mail.oktet.ru>
Hi Dmitry,
> I've compiled binutils/gcc for arm-wince-pe target.
> Using the tools I'm trying to compile sample file probe.c with the
> following function:
>
> int foo(int a)
> {
> return a * 2;
> }
>
> Then I'm doing arm-wince-pe-objdump -d probe.o
> and seeing only the following line:
>
> probe.o: file format pe-arm-little
>
> Where is the disassembled instructions?
> Is it a bug in binutils, or may be I misunderstand something?
It is a bug in binutils.
A workaround is to use the -D switch to objdump instead of -d. (The
bug is that the .text section is being created without the EXECUTABLE
attribute, so objdump does not know that it contains instructions).
The solution is to apply this patch to your sources and rebuild libbfd
and objdump.
Cheers
Nick
2003-07-24 Nick Clifton <nickc@redhat.com>
* coff-arm.c (EXTRA_S_FLAGS): Include SEC_CODE so that code
sections are assigned the LOAD attribute.
Index: bfd/coff-arm.c
===================================================================
RCS file: /repositories/repositories/sourceware/src/bfd/coff-arm.c,v
retrieving revision 1.43
diff -c -3 -p -r1.43 coff-arm.c
*** bfd/coff-arm.c 1 Apr 2003 13:08:05 -0000 1.43
--- bfd/coff-arm.c 11 Nov 2003 10:46:59 -0000
*************** coff_arm_final_link_postscript (abfd, pf
*** 2613,2621 ****
#ifndef EXTRA_S_FLAGS
#ifdef COFF_WITH_PE
! #define EXTRA_S_FLAGS (SEC_LINK_ONCE | SEC_LINK_DUPLICATES)
#else
! #define EXTRA_S_FLAGS 0
#endif
#endif
--- 2613,2621 ----
#ifndef EXTRA_S_FLAGS
#ifdef COFF_WITH_PE
! #define EXTRA_S_FLAGS (SEC_CODE | SEC_LINK_ONCE | SEC_LINK_DUPLICATES)
#else
! #define EXTRA_S_FLAGS SEC_CODE
#endif
#endif