This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: RFC: Properly handle protected data symbol with copy relocation
"H. J. Lu" <hjl@lucon.org> writes:
> I am proposing
>
> 1. For ia32, when creating a shared library with a protected data
> variable, we warn that the resulting DSO will lead to main executable
> to be compiled with PIC or be generated with writable text section when
> the data variable is accessed. Linker will issue a warning when a main
> executable is made with writable text section because of it.
> 2. For x86_64, when creating a shared library a protected data
> variable, we warn that the resulting DSO will lead to main executable
> to be compiled with PIC when the data variable is referenced. Linker
> will issue an error when a main executable references a protected data
> symbol with R_X86_64_PC32 since main and DSO may be more than 2GB
> apart.
Seems more or less reasonable. I still don't understand why x86_64
can't simply use a writable text section. I understand that it
doesn't do it; I don't understand why it can't do it.
Ian