OSDev.org

The Place to Start for Operating System Developers
It is currently Thu Mar 28, 2024 4:44 am

All times are UTC - 6 hours




Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: Re: What is wrong with this shared object?
PostPosted: Fri Dec 07, 2018 7:07 am 
Offline
Member
Member

Joined: Wed Jan 08, 2014 8:41 am
Posts: 100
Location: Moscow, Russia
Code:
$ LD_LIBRARY_PATH=. ./1 
./1: error while loading shared libraries: libhello.so: failed to map segment from shared object


You seem to have a problem with your program headers:

Code:
Program Headers:
  Type           Offset             VirtAddr           PhysAddr
                 FileSiz            MemSiz              Flags  Align
  NULL           0x0000000000000000 0x0000000000000000 0x0000000000000000
                 0x0000000000000000 0x0000000000000000         0
  LOAD           0x0000000000000000 0x0000000000001000 0x0000000000001000
                 0x0000000000000000 0x0000000000000000  RW     1000
  LOAD           0x0000000000001000 0x0000000000001000 0x0000000000001000
                 0x0000000000000000 0x0000000000000000  RW     1000
  LOAD           0x0000000000001000 0x0000000000000000 0x0000000000000000
                 0x0000000000000016 0x0000000000000016  R E    1000
  LOAD           0x0000000000002000 0x0000000000001000 0x0000000000001000
                 0x00000000000001f1 0x00000000000001f1  RWE    1000
  DYNAMIC        0x00000000000020f8 0x00000000000010f8 0x00000000000010f8
                 0x00000000000000d0 0x00000000000000d0  RWE    1000


I see three issues here: (1) the first two LOAD segments are both zero size; (2) the other two LOAD segments overlap the first two; (3) the DYNAMIC segment is misaligned -- the alignment is set to 1000 but its address is not page-aligned.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: No registered users and 21 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group