Question: Finding libraries that are required for busybox??

Michael D. Setzer II mikes at guam.net
Mon Jun 25 20:30:46 UTC 2018


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



More information about the busybox mailing list