LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 06-30-2011, 08:00 AM   #1
littlebigman
Member
 
Registered: Aug 2008
Location: France
Posts: 658

Rep: Reputation: 35
Question What is a random library?


Hello

Since I read that executing a library could return its version number, I ran "/lib/libc.so.0" on uClinux, but it triggers an error.

I'm told that random libraries are not directly executable. Does someone know what a random library is?

Thank you.

PS: In case that matters, here's the short version of the error:
Code:
Undefined instruction
<5> - May be used to emulate instructions that are not defined for
<5>   a particular processor implementation.
Deferred Exception context
CURRENT PROCESS:
COMM=libc.so.0 PID=70  CPU=0
TEXT = 0x02200000-0x0223a6f4        DATA = 0x025586f4-0x0255c3f4
 BSS = 0x0255c3f4-0x02560000  USER-STACK = 0x0257fe90

SEQUENCER STATUS:               Not tainted
 SEQSTAT: 00062021  IPEND: 0008  IMASK: ffff  SYSCFG: 0006
  EXCAUSE   : 0x21
  physical IVG3 asserted : <0xffa08720> { _trap + 0x0 }
 RETE: <0x00000000> /* Maybe null pointer? */
 RETN: <0x02330000> [ /bin/inetd + 0x0 ]
 RETX: <0x00000480> /* Maybe fixed code section */
 RETS: <0x020f0cb0> [ /lib/ld-uClibc.so.0 + 0xcb0 ]
 PC  : <0x02580002> /* kernel dynamic memory */
DCPLB_FAULT_ADDR: <0x0257feac> [ libc.so.0 + 0x1feac ]
ICPLB_FAULT_ADDR: <0x02580002> /* kernel dynamic memory */

Hardware Trace:
   0 Target : <0x00003e30> { _trap_c + 0x0 }
     Source : <0xffa086b4> { _exception_to_level5 + 0xa0 } CALL pcrel
   1 Target : <0xffa08614> { _exception_to_level5 + 0x0 }
     Source : <0xffa084d6> { _bfin_return_from_exception + 0x6 } RTX
   2 Target : <0xffa084d0> { _bfin_return_from_exception + 0x0 }
     Source : <0xffa0856c> { _ex_trap_c + 0x74 } JUMP.S
   3 Target : <0xffa084f8> { _ex_trap_c + 0x0 }
     Source : <0xffa08758> { _trap + 0x38 } JUMP (P4)
   4 Target : <0xffa0873e> { _trap + 0x1e }
     Source : <0xffa0873a> { _trap + 0x1a } IF CC JUMP pcrel
   5 Target : <0xffa08720> { _trap + 0x0 }
      FAULT : <0x02580002> /* kernel dynamic memory */ 0x464c
     Source : <0x02580000> /* kernel dynamic memory */ 0x457f
   6 Target : <0x0257ffce> [ libc.so.0 + 0x1ffce ]
     Source : <0x020f0cbc> [ /lib/ld-uClibc.so.0 + 0xcbc ] JUMP (P4)
   7 Target : <0x020f0cb0> [ /lib/ld-uClibc.so.0 + 0xcb0 ]
     Source : <0x0220cabc> [ /lib/libc.so.0 + 0xcabc ] RTS
   8 Target : <0x0220ca24> [ /lib/libc.so.0 + 0xca24 ]
     Source : <0x020f0cbc> [ /lib/ld-uClibc.so.0 + 0xcbc ] JUMP (P4)
   9 Target : <0x020f0cb0> [ /lib/ld-uClibc.so.0 + 0xcb0 ]
     Source : <0x020f44ce> [ /lib/ld-uClibc.so.0 + 0x44ce ] RTS
  10 Target : <0x020f44bc> [ /lib/ld-uClibc.so.0 + 0x44bc ]
     Source : <0x020f44b6> [ /lib/ld-uClibc.so.0 + 0x44b6 ] JUMP.S
  11 Target : <0x020f44a4> [ /lib/ld-uClibc.so.0 + 0x44a4 ]
     Source : <0x020f41fe> [ /lib/ld-uClibc.so.0 + 0x41fe ] RTS
  12 Target : <0x020f41f4> [ /lib/ld-uClibc.so.0 + 0x41f4 ]
     Source : <0x020f1174> [ /lib/ld-uClibc.so.0 + 0x1174 ] RTS
  13 Target : <0x020f1168> [ /lib/ld-uClibc.so.0 + 0x1168 ]
     Source : <0x020f41f0> [ /lib/ld-uClibc.so.0 + 0x41f0 ] CALL pcrel
  14 Target : <0x020f41e0> [ /lib/ld-uClibc.so.0 + 0x41e0 ]
     Source : <0x020f1ece> [ /lib/ld-uClibc.so.0 + 0x1ece ] RTS
  15 Target : <0x020f1eb6> [ /lib/ld-uClibc.so.0 + 0x1eb6 ]
     Source : <0x020f1cba> [ /lib/ld-uClibc.so.0 + 0x1cba ] RTS

Return addresses in stack:
   frame  1 : <0x00020000> { _sys_clock_gettime + 0x80 }
    address : <0x00020000> { _sys_clock_gettime + 0x80 }
ILL
 
Old 06-30-2011, 08:23 AM   #2
fbianconi
Member
 
Registered: Apr 2008
Location: argentina
Distribution: Arch
Posts: 86

Rep: Reputation: 22
In that context means not any library is executable.
Programs are kind of a different thing than libraries. They're both containers of executable code, but the main difference is a program has a defined starting point. A shared library (*.so) it's also an elf but an entry point must be defined in order to make it executable, and this is not a requirement for libraries, since it's main function is to be linked from another program.
 
Old 07-01-2011, 10:23 AM   #3
littlebigman
Member
 
Registered: Aug 2008
Location: France
Posts: 658

Original Poster
Rep: Reputation: 35
Thanks for the info.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
expect script for random password and random commands vanid Linux - Software 4 03-27-2011 11:57 AM
Box is attempting to scan and ssh into random machines using random usernames gianh Linux - Security 2 11-09-2008 05:42 PM
using /dev/random to output random numbers on a text file guguma Programming 4 04-02-2007 01:42 PM
KDE Random wallpaper or script to create symbolic links to random files cvelasquez Linux - Software 2 02-26-2007 06:48 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 05:17 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration