-
Notifications
You must be signed in to change notification settings - Fork 13.5k
[MC] set OpenBSD's ELFOSABI by default (#98158) #98553
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
@llvm/pr-subscribers-lld-elf @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. Testing strategy matches 06cecdc. Take two of #98158 / b64c1de, preexisting test is fixed now. Full diff: https://github.com/llvm/llvm-project/pull/98553.diff 3 Files Affected:
diff --git a/lld/test/ELF/basic-sparcv9.s b/lld/test/ELF/basic-sparcv9.s
index af63dc47ae84e..b2f760f21ab05 100644
--- a/lld/test/ELF/basic-sparcv9.s
+++ b/lld/test/ELF/basic-sparcv9.s
@@ -17,7 +17,7 @@ _start:
# CHECK-NEXT: Class: 64-bit (0x2)
# CHECK-NEXT: DataEncoding: BigEndian (0x2)
# CHECK-NEXT: FileVersion: 1
-# CHECK-NEXT: OS/ABI: SystemV (0x0)
+# CHECK-NEXT: OS/ABI: OpenBSD (0x0)
# CHECK-NEXT: ABIVersion: 0
# CHECK-NEXT: Unused: (00 00 00 00 00 00 00)
# CHECK-NEXT: }
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.s b/llvm/test/MC/ELF/osabi.s
index dc6ad2a349d75..44912f4987c11 100644
--- a/llvm/test/MC/ELF/osabi.s
+++ b/llvm/test/MC/ELF/osabi.s
@@ -10,3 +10,7 @@
# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-freebsd %s | llvm-readobj -h - | \
# RUN: FileCheck %s --check-prefix=FREEBSD
# FREEBSD: OS/ABI: FreeBSD
+
+# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-openbsd %s | llvm-readobj -h - | \
+# RUN: FileCheck %s --check-prefix=OPENBSD
+# OPENBSD: OS/ABI: OpenBSD
|
I did a basic grep for |
I made a mistake in llvm#98553.
I made a mistake in #98553. Sorry.
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/16/builds/1592 Here is the relevant piece of the build log for the reference:
|
That issue is non spurious, but I fixed it immediately after in #98555 |
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/33/builds/545 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/2269 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. Take two of llvm#98158 / b64c1de, which was reverted in llvm#98494 / c026135. Preexisting test is fixed now.
I made a mistake in llvm#98553. Sorry.
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.