Hi Marcus, Thanks. I am able to get this part working. I am facing one more issue during dynamic linking and need some help to understand how to resolve it. In below code part of __dls3 function I found that TPIDRURO register is being used to read the threadId. I would like to understand how kernel should set this value ? As per my understanding kernel should allocate memory and set this register for current task. But when i do this in my kernel the values doesn't match up as MUSL is using some "builtin_tls" ? /* Temporarily set the tls size to the full size of * builtin_tls so that __copy_tls will use the same layout * as it did for before. Then check, just to be safe. */ libc.tls_size = sizeof builtin_tls; if (__copy_tls((void*)builtin_tls) != self) a_crash(); Thanks, NJ On Fri, Jan 8, 2016 at 6:09 AM, Markus Wichmann wrote: > On Thu, Jan 07, 2016 at 06:29:48PM -0500, N Jain wrote: > > Hi Rich, > > > > Thanks I am able to get my dynamic linker loaded into memory but facing > > issue during application load at __dls3 function. > > I am getting following print from MUSL - > > > > "musl libc > > Version 1.1.10 > > Dynamic Program Loader > > Usage: hello.elf [options] [--] pathname--2--" > > > > Not sure why my application is not getting loaded in below code __dls3 > > function ? > > > > That's what I was trying to tell you in my first answer: You need to set > argv[0] to something (doesn't matter so long as it's not "ldd"), and > argv[1] to the program file you want to run. (And argc to 2, obviously). > > The only alternative to that is to load the program file in the kernel > additionally to musl, and then set the following aux vectors: > > AT_BASE - base address of dynamic linker > AT_PHDR - address of main executable's program headers > AT_PHNUM, AT_PHENT - number and size of main executable's program > headers, respectively. > AT_ENTRY - main executable's entry point > > Ciao, > Markus >