Hi Denys, Denys Vlasenko schrieb: > Yes. For example, noticing something wrong here? > > m_name = xstrdup(bb_basename(m_filename)); > *strrchr(m_name, '.') = 0; > > I just tested. It does segfault. > >> and does >> not load the whole file; instead it tries to load only the parts >> of the file it needs. This makes changing the code to use the >> "smart API for .gz files" trickier. No one has had interest to >> do it yet. > > But it does not look to be _too_ hard. bb_init_module_24() > is an entry point to 2.4 module loading. It opens a file. > Then file descriptor gets passed _only_ to obj_load() > and obj_load_progbits(). Those only ever seek and read from it. > > By replacing "int fd" param with "void *image, size_t image_size" > pair and passing it instead, we can work on in-memory images. > Unpacking and reading of .gz modules is _extremely_ easy too: > > size_t len = MAXINT(ssize_t); > void *image = xmalloc_open_zipped_read_close(filename, &len); > > That's it. > > Care to make it work, Guenter? > > (If you do, fetch svn tree, in older trees it was using > FILE-based i/o, for no good reason) Ok, I will give it a try and see how far I make progress... thanks for looking at it and for your suggestions!
I'll be back with either some new probs, or something working :) Guenter. _______________________________________________ busybox mailing list [email protected] http://lists.busybox.net/mailman/listinfo/busybox
