This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Support for -pie flag on PE executables


I don't exactly understand what is going on here. It seems like link_info.shared
is being set when a PIE executable is created?  Is that right?

Right.


That would indicate
that it is not possible to create a PIE DLL, which sort of makes sense but I'm
still not sure why info->shared is being used.

info->shared is set either when DLL is to be created (-shared flag) or when relocatable executable should be created (-pie flag). Without this patch the -pie flag would make the linker think that we want to build a DLL (because it doesn't respect link_info.pie at all), but actually we want only relocatable EXE. The only difference between DLL and relocatable EXE is the DLL flag in PE header and the default base address. My patch just makes the linker correctly interpret these two differences between -pie and -shared.


Regards,
Filip


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]