This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: RFA: Some question I found while reviewing coffcode
- From: Ian Lance Taylor <iant at google dot com>
- To: Kai Tietz <Kai dot Tietz at onevision dot com>
- Cc: Binutils <binutils at sourceware dot org>, "Kai Tietz" <ktietz70 at googlemail dot com>
- Date: Tue, 13 Jan 2009 07:02:41 -0800
- Subject: Re: RFA: Some question I found while reviewing coffcode
- References: <OF468901E4.5F477246-ONC125753D.0032C845-C125753D.003563F6@onevision.de>
Kai Tietz <Kai.Tietz@onevision.com> writes:
>> Note that you are discussing PE, not COFF. COFF is a much older
>> object file format, PE is an extension.
>
> Well, I am aware that COFF means typically just the object file format.
> But PE/PE+ are imagefile formats based on COFF, not an extension IMHO.
PE is very definitely an extension of COFF. COFF was invented for
SVR3 Unix, and was also implemented for a number of embedded systems.
SVR3 COFF had shared libraries which lived at fixed addresses. It had
nothing like PE DLLs or COMDAT. I would say that PE is to COFF as the
old SunOS shared library system is to a.out.
>> > 1) Treating of IMAGE_SCN_LNK_INFO
>> > As coff spec says "The section contains comments or other
>> > information. The .drectve section has this type. This is valid for
>> > object files only." and "A section is a directive section if it has
>> > the IMAGE_SCN_LNK_INFO flag set in the section header and has the
>> > .drectve section name. The linker removes a .drectve section after
>> > processing the information, so the section does not appear in the
>> > image file that is being linked. "
>> > At the moment are sections with the IMAGE_SCN_LNK_INFO flag mark as
>> > SEC_DEBUGGING (when COFF_PAGE_SIZE is known). But at least for the
>> > .drectve it should be SEC_EXCLUDE, IIUC.
>>
>> Yes. This should probably be set in process_def_file in ld/pe-dll.c.
> I agree, that the interpretation of some of those linker directives can be
> done in ld/pe-dll.c, but the real change here is in coffcode.h. Because
> here it is marked as SEC_DEBUGGING, which means strip happily remove those
> information, but IIUC they should be removed by ld itself.
Sure, you could add it there #ifdef COFF_WITH_PE.
Ian