OSDN Git Service

ldso: fix standalone execution on x86_64 architecture
authorCédric VINCENT <cedric.vincent@st.com>
Mon, 7 Apr 2014 08:04:40 +0000 (10:04 +0200)
committerBernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Tue, 8 Apr 2014 13:19:48 +0000 (15:19 +0200)
commit278a06d7abcc8774ba9bb9c15779749c7e2d68cd
tree1cb6c4676ba1da2d6c42f4bad72091807c632c8b
parent9902a14bea380686320279c22bb01c53f81f4266
ldso: fix standalone execution on x86_64 architecture

If the dynamic linker is built with LDSO_STANDALONE_SUPPORT=y, it can
load then run a dynamically linked program when explicitly invoked
from the command line.  This is used for test and prelink purposes,
and also by other tools like PRoot to force the kernel to load the
right ELF interpreter.

This feature is currently broken on x86_64 since the number of command
line arguments (ie. argc) passed from the kernel is an "elf_addr_t"
(64 bit on x86_64), whereas it is read as an "unsigned int" (32 bit on
x86_64).

Ref: https://github.com/cedric-vincent/PRoot/issues/45
Signed-off-by: Cédric VINCENT <cedric.vincent@st.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
ldso/ldso/ldso.c