public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* Re: linker problem with WinCE exe's
  1999-07-01  0:00 linker problem with WinCE exe's wisi
@ 1999-07-01  0:00 ` Ian Lance Taylor
  0 siblings, 0 replies; 2+ messages in thread
From: Ian Lance Taylor @ 1999-07-01  0:00 UTC (permalink / raw)
  To: richard.wisenoecker; +Cc: binutils

   Date: Fri, 04 Jun 1999 21:43:19 +0200
   From: wisi <richard.wisenoecker@gmx.at>

   Actually I have an error in the linker with the "import information"
   section of WinCE exe files.
   This stuff is in the .idata section. This section has subsections as
   .idata$2, .idata$3,...,idata$6. The interesting thing is that symbols
   are reallocated correctly.
   I have just an error when the address of the start of .idata$4 is needed

   (In detail: the error occurs at the .idata section offset 0x0 where the

   address of the beginning of .idata$4 should be and at offset 0x10 where
   the address of .idata$5 should be).
   After reallocation I always found the start address of .idata.
   In the function bfd_perform_relocation (in reloc.c) the variables
   symbol->value and  symbol->section->output_offset are always 0.

   It seems to me, that one of these two values (value or output_offset)
   should hold the offset of the subsection inside the section.
   The problem I have is, that I didn't found the function which is
   responsible for this (I spent already some hours with debugging and
   analyzing the code).

I have no idea what the actual problem is here.  However, I can tell
you how this stuff is supposed to work.

You call .idata$2, etc., subsections, but BFD does not have that
concept.  I would describe .idata$2, etc., as input sections which are
(I believe) placed into an output section named .idata.

There is an input BFD and an output BFD.  Similarly, there is an input
section and an output section.

In bfd_perform_relocation, the following should be true:

symbol->value is the offset of the symbol within the input section.

symbol->section->output_section->vma is the VMA of the output section
symbol->in the output BFD.

symbol->section->output_offset is the offset of the input section
symbol->within the output section.

The linker map file generated by the -M option should show you how and
where the linker puts input sections into output sections.

As a side note, I don't think the i386 PE support should be going
through bfd_perform_relocation.  I believe it should be using
_bfd_coff_generic_relocate_section instead.  See bfd/doc/bfdint.texi
for a partial description of linker relocation handling.

Ian

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

* linker problem with WinCE exe's
@ 1999-07-01  0:00 wisi
  1999-07-01  0:00 ` Ian Lance Taylor
  0 siblings, 1 reply; 2+ messages in thread
From: wisi @ 1999-07-01  0:00 UTC (permalink / raw)
  To: egcs binutils

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1586 bytes --]

Hi !

I try to finish the port of gcc to WinCE (based on the sources of
http://hyperion.clc.cc.il.us/~arty/ ).

Actually I have an error in the linker with the "import information"
section of WinCE exe files.
This stuff is in the .idata section. This section has subsections as
.idata$2, .idata$3,...,idata$6. The interesting thing is that symbols
are reallocated correctly.
I have just an error when the address of the start of .idata$4 is needed

(In detail: the error occurs at the .idata section offset 0x0 where the

address of the beginning of .idata$4 should be and at offset 0x10 where
the address of .idata$5 should be).
After reallocation I always found the start address of .idata.
In the function bfd_perform_relocation (in reloc.c) the variables
symbol->value and  symbol->section->output_offset are always 0.

It seems to me, that one of these two values (value or output_offset)
should hold the offset of the subsection inside the section.
The problem I have is, that I didn't found the function which is
responsible for this (I spent already some hours with debugging and
analyzing the code).

Please, could anybody tell me, if I am on the right way and if so, where

I can find the value of the offset of a subsection inside a section ?
And additionally, in which function (module) the calcualtion of this
offset will be performed ?

My problem is, that I don't understood in detail how the linking works.
I was just debugging and looking into the code.


I thank you for any help,

Richard


----------------------------------
Richard Wisenöcker
Vienna, Austria




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

end of thread, other threads:[~1999-07-01  0:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-07-01  0:00 linker problem with WinCE exe's wisi
1999-07-01  0:00 ` Ian Lance Taylor

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