Prelink Error: Link Error: Partition Size Too Small for Data
I am using prelink on an ARM system with Linux 2.6.35. I am using Glibc 2.12.2. I would like to pre-use my libraries and application executables. However, I cannot link to anything that relies directly on glibc. When prelink tries to run on
, it throws an error:
Could not write /lib/libc-2.12.2.so: Layout error: section size too small for data
Is there a way to fix this, or perhaps convince prelink that prelink is everything but what's in
? I know about blacklisting in
, but then prelink will be wrong because it can't find dependencies located in that directory.
Here is my prelink.conf
~ # cat /etc/prelink.conf -h /usr/local/Qt-4.7.4/lib -h / usr / lib -h / lib -h / usr / local / dbus / lib -h / usr / local / sqlite / lib -h / usr / local / ncurses / lib -h / usr / local / expat / lib -h / usr / local / ssl / lib
I am on the i.MX51 platform from Freescale. This is ARM Cortex-8. Being that I have compiled everything with the version of GCC / g ++ that came with our development kit, I assume the ELF binaries are 32-bit.
I changed the -h flags to -l and moved the system libraries to the top of the list. I still get the same error.
I am using prelink on a device and not on my cross build machine.
LD_LIBRARY_PATH contains / lib and / usr / lib
Tried prelink like: prelink -a prelink -amR
and got the same result in both directions.
I am running gcc cross compiler 4.4.6. I am running ld 1.12.1 ld.
source to share
Layout error: section size too small for data
is thrown in libelf on the following line https://github.com/path64/compiler/blob/master/src/libelf/lib/update.c#L230 .
This is caused by prelink in write_dso
if (elf_update (dso->elf, ELF_C_WRITE) == -1) return 2;
, which is called in the main.c of the prereference along with a few other places.
This is because the size of the partition data being moved is larger than the size of the partition to which it is being moved.
Which prelink command are you using?
What's your prelink.cache?
Are your binaries / libraries ELF32 or ELF64?
The file utility will inform you.
What are gcc version, binutil version, libelf and prelink versions?
will tell you. Along with
will inform you.
What options were compiled by glibc? In particular, what about -fPIC?
Is the prelink done on the device itself? or under cross-compilation conditions?
Why is your prelink configuration missing lines
? The strings
will follow symlinks, which might not be what you want if your build root has symlinks in the library directories? Also, usually the / lib and / usr / lib entries go first to prelink.conf, like an example here .
Is the -m pre-referenced to access virtual memory? If you blacklisted everything in / lib, I suppose you cannot pre-use any library or binary link that links to a library in / lib, similarly if you blacklisted / lib / libc -2.12.2. so then you can't do everything related to it as the pre-linked file needs its libraries to be pre-linked as well.
As for a possible fix, without more information, it's hard to tell, but it could be due to wrong switches passed to prelink or mixing 32 bit or 64 bit libraries in the same directory in the prelink cache or config file.
More information on links and provisional links is available
source to share