PATCH: allow PE executables to have an export table

Danny Smith dannysmith@clear.net.nz
Sat Jan 11 10:32:00 GMT 2003


Hello

This  patch breaks generation of relocateable output files
(using -r switch), throwing error  in pe-dll.c (generate_reloc)

Here is a testcase:

/* foo.c */
__declspec(dllexport) int foo() {return 1;}

/* bar.c */
__declspec(dllexport) int bar() {return 1;}

gcc -c foo.c
gcc -c bar.c
ld -o foobar.o -r foo.o bar.o

DJ: zero vma section reloc detected: `.text' #0 f=563
DJ: zero vma section reloc detected: `.text' #0 f=563


----- Original Message -----
From: "Charles Wilson" <cwilson@ece.gatech.edu>
To: <binutils@sources.redhat.com>
Sent: Friday, 3 January 2003 12:07
Subject: Re: PATCH: allow PE executables to have an export table


> Tested on cygwin, works as advertised.  Updated patch attached (to
apply
> cleanly to current CVS, and hopefully address the formatting issues).
>
> Also, I found that there is a symbol that appears in .exe's that
> auto-export picks up on, but shouldn't.  So, this patch adds
> 'cygwin_crt0' to the list of exclusions.
>
> --Chuck
>
> 2002-12-10  Fabrizio Gennari  <fabrizio.ge@tiscalinet.it>
>
> * ld/pe-dll.c (process_def_file): don't create an export
> section if there are no exports and we're building an exe
> (pe_dll_build_sections): ditto
> (pe_dll_fill_sections): since this now gets called
> even when we're building an exe, conditionalize setting
> abfd->dll true on info->shared
> * ld/emultempl/pe.em (gld_${EMULATION_NAME}_after_open):
> if i386pe or armpe, call pe_dll_build_section()
> for both exe's and dll's, not just dll's.
> (gld_${EMULATION_NAME}_finish): for all targets except
> shpe and mipspe, call pe_dll_fill_sections() for both
> exe's and dll's, not just dll's.
>
> 2003-01-03  Charles Wilson  <cwilson@ece.gatech.edu>
>
> * ld/pe-dll.c (autofilter_symbollist): add cygwin_crt0
>





More information about the Binutils mailing list