Question: Finding libraries that are required for busybox??

Michael D. Setzer II mikes at guam.net
Tue Jun 26 03:01:27 UTC 2018


On 25 Jun 2018 at 16:35, Jody Bruchon wrote:

Subject:        	Re: Question: Finding libraries that are required for 
busybox??
To:             	busybox at busybox.net
From:           	Jody Bruchon <jody at jodybruchon.com>
Date sent:      	Mon, 25 Jun 2018 16:35:57 -0400

> libc.so.6 is the only thing that's linked to your binary directly; the 
> other libraries can't be detected in these ways so you won't see them.
> 

I went ahead and built a static version of busybox, but it increase the size by 
about 900K.

-rwxr-xr-x. 1 root root 1280672 Jun 26 08:46 busybox
-rwxr-xr-x. 1 root root   383700 Jun 26 08:12 busybox.save

Seems there should be a way to find what libraries might be used if ldd 
doesn't list them?? Have other programs that also use libc.so.6, so it needs 
to be included for them? There were about 60 total libraries that were not 
listed by ldd (Many are the various link files to the library).

The original busybox build was from the second project maintainer back in 
2004 before I took over. Had only added a few things from time to time. 
There were a number of busybox applets built-in, but they had no links, so I 
removed them. 

Guess I'll have to try each program to see if I can find any other issues. Was 
doing a traceroute when I found the name lookup failed, so nslookup wasn't 
working because of the missing files. 

Thanks again for all the info.



> On 6/25/2018 4:30 PM, Michael D. Setzer II wrote:
> > On 25 Jun 2018 at 15:30, Eli Schwartz wrote:
> >
> > Subject:	Re: Question: Finding libraries that are required for busybox??
> > To:	busybox at busybox.net
> > From:	Eli Schwartz <eschwartz at archlinux.org>
> > Date sent:	Mon, 25 Jun 2018 15:30:21 -0400
> >
> >> On 06/25/2018 03:20 PM, Jody Bruchon wrote:
> >>> By the way, you can also grab the relocations directly from the
> >>> binary with this horrific expression (replace the path as needed):
> >>>
> >>> readelf -d /bin/busybox | sed 's/.*\[\([^]]*\)]/\1/'
> >>>
> >>> Scary but effective.
> >> That's some very complicated sed there, and it also doesn't suppress the
> >> non-matched lines with -n, and you could skip several of those escapes
> >> by using -r
> >>
> >> Alternatively:
> >>
> >> objdump -p /bin/busybox | awk '/NEEDED/{print $2}'
> >>
> >> Effective, not scary at all.
> >>
> >> -- 
> >> Eli Schwartz
> >> Bug Wrangler and Trusted User
> >>
> >>
> > Thanks for all the quick reponses. Tried the options, but am just seeing a link
> > to libc.so.6 and no other libraries??
> >
> > readelf -d /bin/busybox | sed 's/.*\[\([^]]*\)]/\1/'
> >
> > Dynamic section at offset 0x5cf14 contains 24 entries:
> >    Tag        Type                         Name/Value
> > libc.so.6
> >   0x0000000c (INIT)                       0x804ab90
> >   0x0000000d (FINI)                       0x8091d28
> >   0x00000019 (INIT_ARRAY)                 0x80a5f0c
> >   0x0000001b (INIT_ARRAYSZ)               4 (bytes)
> >   0x0000001a (FINI_ARRAY)                 0x80a5f10
> >   0x0000001c (FINI_ARRAYSZ)               4 (bytes)
> >
> >   0x6ffffef5 (GNU_HASH)                   0x80481ac
> >   0x00000005 (STRTAB)                     0x8049520
> >   0x00000006 (SYMTAB)                     0x8048260
> >   0x0000000a (STRSZ)                      2591 (bytes)
> >   0x0000000b (SYMENT)                     16 (bytes)
> >   0x00000015 (DEBUG)                      0x0
> >   0x00000003 (PLTGOT)                     0x80a6000
> >   0x00000002 (PLTRELSZ)                   2304 (bytes)
> >   0x00000014 (PLTREL)                     REL
> >   0x00000017 (JMPREL)                     0x804a290
> >   0x00000011 (REL)                        0x804a248
> >   0x00000012 (RELSZ)                      72 (bytes)
> >   0x00000013 (RELENT)                     8 (bytes)
> >   0x6ffffffe (VERNEED)                    0x804a198
> >   0x6fffffff (VERNEEDNUM)                 1
> >   0x6ffffff0 (VERSYM)                     0x8049f40
> >   0x00000000 (NULL)                       0x0
> >
> > objdump -p /bin/busybox | awk '/NEEDED/{print $2}'
> > libc.so.6
> >
> > ldd /bin/busybox
> > 	linux-gate.so.1 (0xb7f6a000)
> > 	libc.so.6 => /lib/libc.so.6 (0xb7d84000)
> > 	/lib/ld-linux.so.2 (0xb7f6c000)
> >
> > ldd /lib/libc.so.6
> > 	/lib/ld-linux.so.2 (0xb7f67000)
> > 	linux-gate.so.1 (0xb7f65000)
> >
> >
> > +------------------------------------------------------------+
> >   Michael D. Setzer II - Computer Science Instructor (Retired)
> >   mailto:mikes at guam.net
> >   mailto:msetzerii at gmail.com
> >   Guam - Where America's Day Begins
> >   G4L Disk Imaging Project maintainer
> >   http://sourceforge.net/projects/g4l/
> > +------------------------------------------------------------+
> >
> > http://setiathome.berkeley.edu (Original)
> > Number of Seti Units Returned:  19,471
> > Processing time:  32 years, 290 days, 12 hours, 58 minutes
> > (Total Hours: 287,489)
> >
> > BOINC at HOME CREDITS
> >
> > ROSETTA      65587495.678649 | ABC          16613838.513356
> > SETI        109399756.726799 | EINSTEIN    141174224.499240
> >
> > _______________________________________________
> > busybox mailing list
> > busybox at busybox.net
> > http://lists.busybox.net/mailman/listinfo/busybox
> 
> _______________________________________________
> busybox mailing list
> busybox at busybox.net
> http://lists.busybox.net/mailman/listinfo/busybox


+------------------------------------------------------------+
 Michael D. Setzer II - Computer Science Instructor (Retired)     
 mailto:mikes at guam.net                            
 mailto:msetzerii at gmail.com
 Guam - Where America's Day Begins                        
 G4L Disk Imaging Project maintainer 
 http://sourceforge.net/projects/g4l/
+------------------------------------------------------------+

http://setiathome.berkeley.edu (Original)
Number of Seti Units Returned:  19,471
Processing time:  32 years, 290 days, 12 hours, 58 minutes
(Total Hours: 287,489)

BOINC at HOME CREDITS

ROSETTA      65587495.678649 | ABC          16613838.513356
SETI        109399756.726799 | EINSTEIN    141174224.499240



More information about the busybox mailing list