ld -Ttext 0x80000 causes segmentation fault

Jinxin Song jinxin@kth.se
Thu Jun 25 16:27:00 GMT 2015


This is probably the same problem with
https://sourceware.org/ml/binutils/2000-07/msg00102.html,

I was trying to locate the text section to a specific address below the 
default address 0x08048000,which is the default address on which ld 
starts the first PT_LOAD segment on Linux/x86.

What I found out is that when I try address which the last 12bit is 
greater  or equal than 0x200(e.g.0xXXX200, 
0xXXX400,0xXXX500,...,0xXXX900 )the program works without any 
problem,but if I try with address where the last 12bit is less than 
0x200(e.g. 0xXXX000 or 0xXXX100) the program would produce a 
segmentation fault. moreover,if  I use the readelf to read the binary, I 
find that the paddr of PHDR would be 0 with those segmentation binary.

Could you please give me any explanation of this weird problem?


Song



More information about the Binutils mailing list