This is the mail archive of the binutils@sourceware.org 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]

[PATCH, MIPS] Fix typo in N64 PLT stub


Richard,

The following patch fixes a typo in N64 PLT stub.  The register move that saves return address for dynamic resolver to return to currently uses a 32-bit instruction, which truncates upper bits of the return address.

Now, I imagine you would ask why is there a 64-bit address in the PLT resolver that only works with 32-bit symbols (aka -msym32).  The answer is that the 64-bit return address leaks to the PLT0 from a shared library, which kernel is free to map anywhere it pleases.  The most common case is for C library to call atexit callbacks from a C++ application.

The -msym32 restriction applies only to symbols in executables, as those do have PLTs.  Symbols in shared libraries cannot have PLTs, and, simultaneously, they can't be guaranteed to be mapped to lower 32-bits of address space.

The patch was tested on GCC and GLIBC testsuites on MIPS64 target with no regressions between "-mabi=64" and "-mabi=64 -mplt -msym32" runs.

OK to apply?

Thank you,

--
Maxim Kuvyrkov
CodeSourcery / Mentor Graphics


Attachment: bfd-mips-64bit-plt.patch
Description: Binary data

Attachment: bfd-mips-64bit-plt.ChangeLog
Description: Binary data


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