Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

i#7360: Fix ldscript creation with binutils 2.44 and preferred base set #7369

Merged
merged 3 commits into from
Mar 19, 2025

Conversation

ziyao233
Copy link
Member

We used to adjust current location pointer to our preferred base address at start of the linkscript, which creates a hole in the address space and allows the linker to put the ELF header and other sections before address of __executable_start symbol. This causes assertion failures when building with binutils 2.44,

Internal Error: DynamoRIO debug check failure:
/dynamorio/core/unix/os.c:9618 check_start == dynamo_dll_start

Since binutils ld.bfd always determines the base address by

. = SEGMENT_START("text-segment", 0x400000) + SIZEOF_HEADERS;

starting from at least 2003, it should be fine to drop the extra adjustment and only replace the default base with our preferred base.

Fixes: #7360

We used to adjust current location pointer to our preferred base address
at start of the linkscript, which creates a hole in the address space
and allows the linker to put the ELF header and other sections before
address of __executable_start symbol. This causes assertion failures
when building with binutils 2.44,

	Internal Error: DynamoRIO debug check failure:
	/dynamorio/core/unix/os.c:9618 check_start == dynamo_dll_start

Since binutils ld.bfd always determines the base address by

	. = SEGMENT_START("text-segment", 0x400000) + SIZEOF_HEADERS;

starting from at least 2003, it should be fine to drop the extra
adjustment and only replace the default base with our preferred base.

Fixes: DynamoRIO#7360
@ziyao233 ziyao233 requested a review from derekbruening March 18, 2025 12:08
@ziyao233 ziyao233 merged commit 6d276c0 into DynamoRIO:master Mar 19, 2025
27 of 28 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ASSERT (11.3.0) dynamo_dll_start mismatches the mapping provided by kernel on x86_64 Linux with binutils 2.44
2 participants