-
Notifications
You must be signed in to change notification settings - Fork 101
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
Check for a branded ELF note when OS/ABI is NONE #1344
Open
ararslan
wants to merge
3
commits into
master
Choose a base branch
from
aa/elf-note
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 1 commit
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
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
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -5,7 +5,19 @@ using Dates: DateTime, datetime2unix | |||||
|
||||||
function check_os_abi(oh::ObjectHandle, p::AbstractPlatform, rest...; verbose::Bool = false, kwargs...) | ||||||
if Sys.isfreebsd(p) | ||||||
if oh.ei.osabi != ELF.ELFOSABI_FREEBSD | ||||||
# On AArch64 and RISC-V, FreeBSD uses an ELF note section to identify itself rather | ||||||
# than OS/ABI in the ELF header. In that case, the OS/ABI will be generic Unix (NONE). | ||||||
# See https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=252490 and | ||||||
# https://github.com/freebsd/freebsd-src/blob/main/lib/csu/common/crtbrand.S | ||||||
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.
Suggested change
|
||||||
if oh.ei.osabi == ELF.ELFOSABI_NONE | ||||||
if os_from_elf_note(oh) != "FreeBSD" | ||||||
if verbose | ||||||
@warn("$(basename(path(oh))) does not have a FreeBSD-branded ELF note " * | ||||||
"and may be unrecognized or unusable on $p") | ||||||
end | ||||||
return false | ||||||
end | ||||||
elseif oh.ei.osabi != ELF.ELFOSABI_FREEBSD | ||||||
# The dynamic loader should not have problems in this case, but the | ||||||
# linker may not appreciate. Let the user know about this. | ||||||
if verbose | ||||||
|
@@ -17,7 +29,8 @@ function check_os_abi(oh::ObjectHandle, p::AbstractPlatform, rest...; verbose::B | |||||
end | ||||||
return false | ||||||
end | ||||||
elseif call_abi(p) == "eabihf" | ||||||
end | ||||||
if call_abi(p) == "eabihf" | ||||||
# Make sure the object file has the hard-float ABI. See Table 4-2 of | ||||||
# "ELF for the ARM Architecture" document | ||||||
# (https://developer.arm.com/documentation/ihi0044/e/). Note: `0x000` | ||||||
|
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.
Should we just delete
platform_for_object
since it appears to be unused?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.
Sure, I can if you'd like me to.