AnsweredAssumed Answered

FLAT shared library problem

Question asked by on Jun 9, 2014
Latest reply on Jun 12, 2014 by sonic

Hey everyone,


I'm trying to use flat shared libraries for my project which requires very small executables (very low bandwidth) and has a modular structure.


I increased the MAX_SHARED_LIBS in the flat header, but I don't seem to be able to use shared libs with an ID >=4.

grep -rn confirms that all occurances of the define are indeed set to 16 now...


When I try to launch the application:


root:/> ./mnt/uhftransmittest.bfin  BINFMT_FLAT: reloc address 0x44c58 not in same module (5 != 1), killing uhftransmittest! BINFMT_FLAT: failed to load library 5, killing uhftransmittest! SEGV  


I tried dynamic linking to lib3 and lib5 there, both are in /lib/. Both work on their own if they're compiled with id 3. lib4 doesn't work either.


The applications linker flags:


LDFLAGS_bfin +=  -l:$(OUTPATH)/libc2bitset.a.bfin \                         -l:$(OUTPATH)/libc2bch.a.bfin \                         -l:$(OUTPATH)/libc2crc.a.bfin \                         -Wl,-R,$(OUTPATH)/libencoder_so.gdb \                         -Wl,-R,$(OUTPATH)/libmodulator_so.gdb


The libs are build according to the "creating libraries" wiki.


What can I do? Where's the mistake?


I tried switching to FDPIC, but the image is just enormous...which on it's wouldn't be all that bad, as long as it fits in my flash, but I'd prefer the flat format for size reasons as long as I can use a couple of shared libraries.


Thank you for your help,