• Laurent Dufour's avatar
    ppc64: handle gcc memcpy optimisation · 0570dd81
    Laurent Dufour authored
    The commit 871da9a1 ("pie: Give VDSO symbol table local scope")
    move the definition of the vdso_symbols from global to local variable
    in vdso_fill_symtable(). This makes sense since this variable is only
    used in this function. However this raises a build issue on powerPC,
    where a memcpy undefined symbol is detected when doing the first
    relocation phase of the parasite code:
    
    parasite_blob: Error (pie/piegen/elf.c:258): Unexpected undefined
    symbol:memcpy
    
    This memcpy symbol is pulled by the C compiler generated code which
    tries to optimize the stack initialization when entering
    vdso_fill_symtable(). The optimization is done by copying the
    initialized data to the stack using memcpy. But when building the
    parasite code, the C library is not linked and there is no memcpy
    symbol. However there is builtin_memcpy() which is doing the same.
    
    Ideally, the builtin_memcpy should be named memcpy() to replace the C
    library one, and it should only be built for the parasite/restorer
    code. But the way CRIU is built, the same vdso-util.o file is used
    twice for criu which is linked with the C library and by the
    parasite/restorer code. Thus naming builtin_memcpy memcpy leads to
    belongs on builtin_memcpy even when the C library is in the picture,
    which is not the best option (assuming C library mem operation are
    more efficient).
    
    Among the memcpy symbol issue, this shows that same objects are used
    both in CRIU and the parasite/restorer code. This should not be the
    case since parasite/restorer are built in pie form and criu's object
    not. The shared code should be built twice, once on pie form for the
    parasite/restorer code, once *normally* for the criu binary.
    
    Addressing the build issue implies more work than expected.
    For the moment, this patch is defining a memcpy service when building
    the parasite code to fix the build issue on ppc64.
    Once the build issue is addressed, builtin_memcpy should be renamed
    memcpy and only be used for parasite/restorer code, and this
    definition removed.
    Signed-off-by: 's avatarLaurent Dufour <ldufour@linux.vnet.ibm.com>
    Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
    0570dd81
Name
Last commit
Last update
Documentation Loading commit data...
arch Loading commit data...
contrib Loading commit data...
include Loading commit data...
lib Loading commit data...
pie Loading commit data...
protobuf Loading commit data...
pycriu Loading commit data...
scripts Loading commit data...
test Loading commit data...
.gitignore Loading commit data...
.mailmap Loading commit data...
.travis.yml Loading commit data...
COPYING Loading commit data...
CREDITS Loading commit data...
Dockerfile Loading commit data...
Makefile Loading commit data...
Makefile.config Loading commit data...
Makefile.crtools Loading commit data...
Makefile.inc Loading commit data...
README.md Loading commit data...
action-scripts.c Loading commit data...
aio.c Loading commit data...
bfd.c Loading commit data...
cgroup.c Loading commit data...
cr-check.c Loading commit data...
cr-dedup.c Loading commit data...
cr-dump.c Loading commit data...
cr-errno.c Loading commit data...
cr-exec.c Loading commit data...
cr-restore.c Loading commit data...
cr-service.c Loading commit data...
cr-show.c Loading commit data...
crit Loading commit data...
crtools Loading commit data...
crtools.c Loading commit data...
eventfd.c Loading commit data...
eventpoll.c Loading commit data...
fifo.c Loading commit data...
file-ids.c Loading commit data...
file-lock.c Loading commit data...
files-ext.c Loading commit data...
files-reg.c Loading commit data...
files.c Loading commit data...
fsnotify.c Loading commit data...
image-desc.c Loading commit data...
image.c Loading commit data...
ipc_ns.c Loading commit data...
irmap.c Loading commit data...
kcmp-ids.c Loading commit data...
kerndat.c Loading commit data...
libnetlink.c Loading commit data...
log.c Loading commit data...
lsm.c Loading commit data...
mem.c Loading commit data...
mount.c Loading commit data...
namespaces.c Loading commit data...
net.c Loading commit data...
netfilter.c Loading commit data...
page-pipe.c Loading commit data...
page-read.c Loading commit data...
page-xfer.c Loading commit data...
pagemap-cache.c Loading commit data...
parasite-syscall.c Loading commit data...
pipes.c Loading commit data...
plugin.c Loading commit data...
proc_parse.c Loading commit data...
protobuf-desc.c Loading commit data...
protobuf.c Loading commit data...
pstree.c Loading commit data...
ptrace.c Loading commit data...
rbtree.c Loading commit data...
rst-malloc.c Loading commit data...
sd-daemon.c Loading commit data...
sd-daemon.h Loading commit data...
security.c Loading commit data...
seize.c Loading commit data...
shmem.c Loading commit data...
sigframe.c Loading commit data...
signalfd.c Loading commit data...
sk-inet.c Loading commit data...
sk-netlink.c Loading commit data...
sk-packet.c Loading commit data...
sk-queue.c Loading commit data...
sk-tcp.c Loading commit data...
sk-unix.c Loading commit data...
sockets.c Loading commit data...
stats.c Loading commit data...
string.c Loading commit data...
sysctl.c Loading commit data...
sysfs_parse.c Loading commit data...
timerfd.c Loading commit data...
tty.c Loading commit data...
tun.c Loading commit data...
util.c Loading commit data...
uts_ns.c Loading commit data...
vdso.c Loading commit data...