-
Notifications
You must be signed in to change notification settings - Fork 570
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#2154 Android64: Adjust loader to remove 'CURIOSITIES' #7205
Open
felixc-arm
wants to merge
1
commit into
master
Choose a base branch
from
i2154-android64-prevent-curiosities
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -406,10 +406,15 @@ module_walk_program_headers(app_pc base, size_t view_size, bool at_map, bool dyn | |
LOG(GLOBAL, LOG_INTERP | LOG_VMAREAS, 2, | ||
"%s " PFX ": %s dynamic info\n", __FUNCTION__, base, | ||
out_data->have_dynamic_info ? "have" : "no"); | ||
/* i#1860: on Android a later os_module_update_dynamic_info() will | ||
* fill in info once .dynamic is mapped in. | ||
/* i#1860: on 32-bit Android a later | ||
* os_module_update_dynamic_info() will fill in info | ||
* once .dynamic is mapped in. | ||
* i#XXX: This is not needed on newer versions of 64-bit | ||
* Android, however we are not able to test with newer | ||
* versions of 32-bit Android, so this may still be | ||
* required. | ||
*/ | ||
IF_NOT_ANDROID(ASSERT(out_data->have_dynamic_info)); | ||
IF_NOT_ANDROID32(ASSERT(out_data->have_dynamic_info)); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is not ASSERT_CURIOSITY: this is a regular fatal assert. I don't see any ASSERT_CURIOSITY being changed here: please update the PR title and description as it talks about |
||
} | ||
}); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
set_preferred_base_start_and_end() for lld (the new Android linker, right?) is passing -Ttext so it's not setting the preferred base of the header segment but only the text segment. This is why there is this discrepancy between the preferred "base" and the header, and why a gap is allowed.
What does
readelf -l
say on libdynamorio.so for the different values here? Presumably it matches the runtime behavior and shows the gap between the header and text segments.Even if there were a different way to set the header segment base (
--section-start
with a blank name??) it may not help if the kernel ignores it and always places it up high in the address space: so maybe this-Ttext=0x1000
is the best solution, and maybe-Ttext=0
is ignored or something (presumablyreadelf -l
on that shows a big gap?).Please update the comment here to make it clear this is not really the header base but instead the text segment base only, and the linker puts a big gap if left at default or set to 0, which is why we set it to 0x1000.