[patch/RFC] ld/pe-dll.c: mark .reloc section as discardable unless building a relocatable dll

Shaun Jackman sjackman@pathwayconnect.com
Mon Jul 28 14:49:00 GMT 2003


> > >where the -mdll gcc switch passed this to ld:
> > >--dll -e _DllMainCRTStartup@12

I can't find -mdll documented anywhere in `info gcc` (gcc-3.3). In which
versions of gcc does this switch exist? I currently use
	LDFLAGS="-nostartfiles -e_DllMain -Wl,--dll -Wl,--subsystem=wince:3.00"
Does -mdll accomplish something similar?

Exactly what does --subsystem=wince:3.00 do? `info ld` says "Specifies
the subsystem under which your program will execute.", but how does the
MS OS use this information?

> Uh, oh, I see the  problem now.  Some makefiles (eg the mingw runtime rule for
> libmingwm10.dll)and libtool still use the 'old' way of building relocatable dll's
> with dlltool. eg
> 
> gcc -s -Wl,--base-file,mydll.base -o mydll.dll mydll.o -Wl,-e,_mydll_init@12 
> dlltool --base-file mydll.base --def mydll.def --output-exp mydll.exp --dllname mydll.dll
> gcc -s -Wl,--base-file,mydll.base,mydll.exp -o mydll.dll mydll.o -Wl,-e,_mydll_init@12
> dlltool --base-file mydll.base --def mydll.def --output-exp mydll.exp --dllname mydll.dll
> gcc -Wl,mydll.exp -o mydll.dll mydll.o -Wl,-e,_mydll_init@12

I use the following five step link process
	$(LD) $(LDFLAGS) -Wl,--base-file=$*.base -o $@ $^ $(LDLIBS)
	$(DLLTOOL) -D $*.dll -d $*.def -b $*.base -e $*.exp
	$(LD) $(LDFLAGS) -Wl,--base-file=$*.base -o $@ $^ $*.exp $(LDLIBS)
	$(DLLTOOL) -D $*.dll -d $*.def -b $*.base -e $*.exp -l lib$*.a
	$(LD) $(LDFLAGS) -o $@ $^ $*.exp $(LDLIBS)
because I was told that arm-wince-pe does not support --shared. If this
is true, what's holding it back?

Cheers,
Shaun



More information about the Binutils mailing list