This is the mail archive of the libc-help@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: Regarding "Inconsistency detected by ld.so" 32 Bit Elf


First,Thanks a bunch Carlos for detailed explanation on ELF load segments.  

>>>>> I know that QEMU has to do something similar. There are probably so
>>>>> few applications that need to do this that there is no good accepted
>>>>> standard way to accomplish this.
>> 
>> Yes. I've checked QEMU code and linker script. They are modifying
>> only the executable start address and Text segment in the custom
>> linker script but no new/custom section which reserves VMA space .
> 
> Have you tried doing something similar?

Those custom changes are already live in my linker script which is working as expected (placing an executable in desired location). My changes are little bit more which adds FAKE segment in linker script. There was a similar query I noticed in other sourcewave forum few years back (resolved one). Not sure I can provide link here or not.

>> Here, the first load segment base address is non-zero, so just
>> curious to know whether prelink has some mechanism to detect and
>> relocate only these libraries?
> 
> Why does prelink have to detect anything? It just reads the ELF file
> and knows exactly the layout of the library.

I agree.. Just wondering in my case, I don't want all the system libraries to be prelink'd instead need to perform reloc-only for specific libraries. To achieve this I'm forced to use -rpath and clone the system library then relocate the base address. So, thought if prelink has any internal option to detect such application requirements.

>> Can you please provide me some pointers or docs related to this ?
>> More interested to understand how Kernel decides on ELF placement
>> from code perspective.
> 
> There are no docs, you need to read the source for mmap :-)

Thanks. Due to the PAX code, most of the time messed up with executable load flow :)

KS 		 	   		  

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]