on-internet
← Community

Why is address 0x400000 chosen as a start of text segment in x86_64 ABI?

Stack Overflow ·

In the AMD64 SysV ABI document on p. 33 it says the text segment typically starts at 0x400000, documenting default ld behaviour. Why was this particular address chosen? Is there any reason for that? We can confirm that this is GNU ld's default on Linux: $ ld -verbose | grep -i text-segment PROVIDE (__executable_start = SEGMENT_START("text-segment", 0x400000)); . = SEGMENT_START("text-segment", 0x400000) + SIZEOF_HEADERS; It's surprising because this address is bigger in 32-bit x86 executables: $ ld -verbose | grep -i text-segment PROVIDE (__executable_start = SEGMENT_START("text-segment", 0x08

Comments

Sign in or sign up to comment and upvote.

No comments yet.