This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: arm-wince-pe objdump does not disassemble .text section


Hello Nick.

On Tue, 11 Nov 2003, Nick Clifton wrote:

> > 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).

-D does not work either.


> The solution is to apply this patch to your sources and rebuild libbfd
> and objdump.

Thank you.
Currently I have no time to evaluate your patch since I've already
applied my own (see attachment), and it works for me. (I'm trying to
link GCC produced object files using WinCE4.2 linker, and have another
compatibility issue in the way).

Don't know for sure which approach is better...
Note that MS linker will continue to produce warnings due to different
section flags (.rdata sections in GCC's objects and WinCE's objects)
with your approach. (See MS PE & COFF Rev. 6.0, section 6).
On the other hand my patch may be incomplete (not all special sections
are handled), or it may even brake another binutils functionality.
Therefore, I don't insist on applying my variant.


> 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
>
>
>


...Bye..Dmitry.


Attachment: patch-binutils-2.14
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]