public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* Question on where input_sections are populated
@ 2007-08-10 11:41 Mayank Kumar
  2007-08-11 10:19 ` Alan Modra
  0 siblings, 1 reply; 2+ messages in thread
From: Mayank Kumar @ 2007-08-10 11:41 UTC (permalink / raw)
  To: binutils

Hi All
I am making some changes in gcc4.2 for making it run on interix. I want to understand where in the code, are all input sections getting populated.
I am encountering an error where in the function size_input_sections, the input_section is showing a wrong value of section->size and section->rawsize parameters for .text sections. I want to trace that down but I am not able to find the place in bfd or ld where this gets populated.
Basically several .text sections get merged into the final output, but in input sections list, I see a kind of junk entry for .text with large size/rawsize parameters.

Any help would be appreciated.


Thanks
Mayank

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

* Re: Question on where input_sections are populated
  2007-08-10 11:41 Question on where input_sections are populated Mayank Kumar
@ 2007-08-11 10:19 ` Alan Modra
  0 siblings, 0 replies; 2+ messages in thread
From: Alan Modra @ 2007-08-11 10:19 UTC (permalink / raw)
  To: Mayank Kumar; +Cc: binutils

bfd/config.bfd says x86 interix uses i386pei_vec.
bfd/configure.in says i386pei_vec target is in pei-i386.c, peigen.c,
cofflink.c.  The last two are generic, so look in pei-i386.c, which
pulls in coff-i386.c.  coff-i386.c has what we are looking for, the
bfd_target struct.  _bfd_check_format[bfd_object] in this struct is
coff_object_p, so look for that.  It's in bfd/coffgen.c, but note
the define in peicode.h!  BFD has lots of horrible defines, especially
in the COFF code.  So we are really using pe_bfd_object_p in
peicode.h, but this calls coff_object_p anyway to do the bulk of the
work.  coff_object_p is where the file is read into a bfd *, and if
you follow down that function you'll find make_a_section_from_file.

Probably more detail than you wanted, but that's the way to pull apart
BFD targets.

-- 
Alan Modra
Australia Development Lab, IBM

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

end of thread, other threads:[~2007-08-11 10:19 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-08-10 11:41 Question on where input_sections are populated Mayank Kumar
2007-08-11 10:19 ` 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).