-
Notifications
You must be signed in to change notification settings - Fork 13.5k
[MC] set OpenBSD's ELFOSABI by default #98158
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
Conversation
Note to self: #97122 (comment) applies to this PR, since I split it. |
bd7871b
to
9da46ac
Compare
@llvm/pr-subscribers-mc Author: John Ericson (Ericson2314) ChangesThis matches what is done for FreeBSD. OpenBSD has a few special program header types, and other such ELF extensions. Setting the ELFOSABI like so will allow LLD to support them without needlessly impacting non-OpenBSD ELFs. Leveraged by #97122 Full diff: https://github.com/llvm/llvm-project/pull/98158.diff 3 Files Affected:
diff --git a/llvm/include/llvm/MC/MCELFObjectWriter.h b/llvm/include/llvm/MC/MCELFObjectWriter.h
index d7c223cdcc07f..12237094ad86a 100644
--- a/llvm/include/llvm/MC/MCELFObjectWriter.h
+++ b/llvm/include/llvm/MC/MCELFObjectWriter.h
@@ -78,6 +78,8 @@ class MCELFObjectTargetWriter : public MCObjectTargetWriter {
return ELF::ELFOSABI_FREEBSD;
case Triple::Solaris:
return ELF::ELFOSABI_SOLARIS;
+ case Triple::OpenBSD:
+ return ELF::ELFOSABI_OPENBSD;
default:
return ELF::ELFOSABI_NONE;
}
diff --git a/llvm/test/MC/ELF/osabi-freebsd.s b/llvm/test/MC/ELF/osabi-freebsd.s
new file mode 100644
index 0000000000000..0dbef293772e9
--- /dev/null
+++ b/llvm/test/MC/ELF/osabi-freebsd.s
@@ -0,0 +1,2 @@
+# RUN: llvm-mc -filetype obj -triple amd64-freebsd %s | llvm-readobj -hS - | FileCheck %s
+# CHECK: OS/ABI: FreeBSD
diff --git a/llvm/test/MC/ELF/osabi-openbsd.s b/llvm/test/MC/ELF/osabi-openbsd.s
new file mode 100644
index 0000000000000..f501dfa7bb126
--- /dev/null
+++ b/llvm/test/MC/ELF/osabi-openbsd.s
@@ -0,0 +1,2 @@
+# RUN: llvm-mc -filetype obj -triple amd64-openbsd %s | llvm-readobj -hS - | FileCheck %s
+# CHECK: OS/ABI: OpenBSD
|
llvm/test/MC/ELF/osabi-freebsd.s
Outdated
@@ -0,0 +1,2 @@ | |||
# RUN: llvm-mc -filetype obj -triple amd64-freebsd %s | llvm-readobj -hS - | FileCheck %s |
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.
I added osabi.s
to unify FreeBSD/Linux/Solaris testing. Consider adding OpenBSD tests there instead of adding a new file.
|
This matches what is done for FreeBSD. OpenBSD has a few special program header types, and other such ELF extensions. Setting the ELFOSABI like so will allow LLD to support them without needlessly impacting non-OpenBSD ELFs. Testing strategy matches 06cecdc.
9da46ac
to
6c2b893
Compare
Thanks @MaskRay! Did each of those things. |
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/153/builds/2651 Here is the relevant piece of the build log for the reference:
|
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/16/builds/1575 Here is the relevant piece of the build log for the reference:
|
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/60/builds/2230 Here is the relevant piece of the build log for the reference:
|
The failure is legit, unless there is a pending fix we should revert. |
This reverts commit b64c1de.
Reverts #98158 bot is broken.
Sorry about that. So the failure broke |
#98553 is the next attempt. |
This matches what is done for FreeBSD. OpenBSD has a few special program header types, and other such ELF extensions. Setting the ELFOSABI like so will allow LLD to support them without needlessly impacting non-OpenBSD ELFs. Testing strategy matches 06cecdc. Take two of #98158 / b64c1de, which was reverted in #98494 / c026135. Preexisting test is fixed now.
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/33/builds/580 Here is the relevant piece of the build log for the reference:
|
This matches what is done for FreeBSD. OpenBSD has a few special program header types, and other such ELF extensions. Setting the ELFOSABI like so will allow LLD to support them without needlessly impacting non-OpenBSD ELFs. Testing strategy matches 06cecdc.
Reverts llvm#98158 bot is broken.
This matches what is done for FreeBSD. OpenBSD has a few special program header types, and other such ELF extensions. Setting the ELFOSABI like so will allow LLD to support them without needlessly impacting non-OpenBSD ELFs. Testing strategy matches 06cecdc. Take two of llvm#98158 / b64c1de, which was reverted in llvm#98494 / c026135. Preexisting test is fixed now.
This matches what is done for FreeBSD.
OpenBSD has a few special program header types, and other such ELF extensions. Setting the ELFOSABI like so will allow LLD to support them without needlessly impacting non-OpenBSD ELFs.
Testing strategy matches 06cecdc.
Leveraged by #97122