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

[MC] set OpenBSD's ELFOSABI by default #98158

Merged
merged 1 commit into from
Jul 11, 2024

Conversation

Ericson2314
Copy link
Member

@Ericson2314 Ericson2314 commented Jul 9, 2024

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

@Ericson2314 Ericson2314 changed the title [LLMV] set OpenBSD's ELFOSABI by default [LLVM] set OpenBSD's ELFOSABI by default Jul 9, 2024
@Ericson2314 Ericson2314 requested a review from brad0 July 9, 2024 13:35
@Ericson2314
Copy link
Member Author

Note to self: #97122 (comment) applies to this PR, since I split it.

@llvmbot llvmbot added the mc Machine (object) code label Jul 10, 2024
@llvmbot
Copy link
Collaborator

llvmbot commented Jul 10, 2024

@llvm/pr-subscribers-mc

Author: John Ericson (Ericson2314)

Changes

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.

Leveraged by #97122


Full diff: https://github.com/llvm/llvm-project/pull/98158.diff

3 Files Affected:

  • (modified) llvm/include/llvm/MC/MCELFObjectWriter.h (+2)
  • (added) llvm/test/MC/ELF/osabi-freebsd.s (+2)
  • (added) llvm/test/MC/ELF/osabi-openbsd.s (+2)
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

@Ericson2314 Ericson2314 requested a review from MaskRay July 10, 2024 14:21
@@ -0,0 +1,2 @@
# RUN: llvm-mc -filetype obj -triple amd64-freebsd %s | llvm-readobj -hS - | FileCheck %s
Copy link
Member

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.

@MaskRay
Copy link
Member

MaskRay commented Jul 10, 2024

[LLVM]

[MC] is a more fine-grained tag.

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.
@Ericson2314 Ericson2314 changed the title [LLVM] set OpenBSD's ELFOSABI by default [MC] set OpenBSD's ELFOSABI by default Jul 11, 2024
@Ericson2314
Copy link
Member Author

Thanks @MaskRay! Did each of those things.

@Ericson2314 Ericson2314 merged commit b64c1de into llvm:main Jul 11, 2024
4 of 6 checks passed
@Ericson2314 Ericson2314 deleted the llvm-elfosabi-openbsd branch July 11, 2024 13:10
@llvm-ci
Copy link
Collaborator

llvm-ci commented Jul 11, 2024

LLVM Buildbot has detected a new failure on builder premerge-monolithic-linux running on premerge-linux-1 while building llvm at step 7 "test-build-unified-tree-check-all".

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:

Step 7 (test-build-unified-tree-check-all) failure: test (failure)
******************** TEST 'lld :: ELF/basic-sparcv9.s' FAILED ********************
Exit Code: 1

Command Output (stderr):
--
RUN: at line 2: /build/buildbot/premerge-monolithic-linux/build/bin/llvm-mc -filetype=obj -triple=sparc64-unknown-openbsd /build/buildbot/premerge-monolithic-linux/llvm-project/lld/test/ELF/basic-sparcv9.s -o /build/buildbot/premerge-monolithic-linux/build/tools/lld/test/ELF/Output/basic-sparcv9.s.tmp
+ /build/buildbot/premerge-monolithic-linux/build/bin/llvm-mc -filetype=obj -triple=sparc64-unknown-openbsd /build/buildbot/premerge-monolithic-linux/llvm-project/lld/test/ELF/basic-sparcv9.s -o /build/buildbot/premerge-monolithic-linux/build/tools/lld/test/ELF/Output/basic-sparcv9.s.tmp
RUN: at line 3: /build/buildbot/premerge-monolithic-linux/build/bin/ld.lld /build/buildbot/premerge-monolithic-linux/build/tools/lld/test/ELF/Output/basic-sparcv9.s.tmp -o /build/buildbot/premerge-monolithic-linux/build/tools/lld/test/ELF/Output/basic-sparcv9.s.tmp2
+ /build/buildbot/premerge-monolithic-linux/build/bin/ld.lld /build/buildbot/premerge-monolithic-linux/build/tools/lld/test/ELF/Output/basic-sparcv9.s.tmp -o /build/buildbot/premerge-monolithic-linux/build/tools/lld/test/ELF/Output/basic-sparcv9.s.tmp2
RUN: at line 4: /build/buildbot/premerge-monolithic-linux/build/bin/llvm-readobj --file-headers --sections -l --symbols /build/buildbot/premerge-monolithic-linux/build/tools/lld/test/ELF/Output/basic-sparcv9.s.tmp2    | /build/buildbot/premerge-monolithic-linux/build/bin/FileCheck /build/buildbot/premerge-monolithic-linux/llvm-project/lld/test/ELF/basic-sparcv9.s
+ /build/buildbot/premerge-monolithic-linux/build/bin/FileCheck /build/buildbot/premerge-monolithic-linux/llvm-project/lld/test/ELF/basic-sparcv9.s
+ /build/buildbot/premerge-monolithic-linux/build/bin/llvm-readobj --file-headers --sections -l --symbols /build/buildbot/premerge-monolithic-linux/build/tools/lld/test/ELF/Output/basic-sparcv9.s.tmp2
/build/buildbot/premerge-monolithic-linux/llvm-project/lld/test/ELF/basic-sparcv9.s:20:15: error: CHECK-NEXT: expected string not found in input
# CHECK-NEXT: OS/ABI: SystemV (0x0)
              ^
<stdin>:12:16: note: scanning from here
 FileVersion: 1
               ^
<stdin>:13:2: note: possible intended match here
 OS/ABI: OpenBSD (0xC)
 ^

Input file: <stdin>
Check file: /build/buildbot/premerge-monolithic-linux/llvm-project/lld/test/ELF/basic-sparcv9.s

-dump-input=help explains the following input dump.

Input was:
<<<<<<
           .
           .
           .
           7: ElfHeader { 
           8:  Ident { 
           9:  Magic: (7F 45 4C 46) 
          10:  Class: 64-bit (0x2) 
          11:  DataEncoding: BigEndian (0x2) 
          12:  FileVersion: 1 
next:20'0                    X error: no match found
          13:  OS/ABI: OpenBSD (0xC) 
next:20'0     ~~~~~~~~~~~~~~~~~~~~~~~
next:20'1      ?                      possible intended match
          14:  ABIVersion: 0 
next:20'0     ~~~~~~~~~~~~~~~
          15:  Unused: (00 00 00 00 00 00 00) 
next:20'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          16:  } 
next:20'0     ~~~
          17:  Type: Executable (0x2) 
next:20'0     ~~~~~~~~~~~~~~~~~~~~~~~~
...

@llvm-ci
Copy link
Collaborator

llvm-ci commented Jul 11, 2024

LLVM Buildbot has detected a new failure on builder llvm-clang-x86_64-expensive-checks-debian running on gribozavr4 while building llvm at step 6 "test-build-unified-tree-check-all".

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:

Step 6 (test-build-unified-tree-check-all) failure: test (failure)
******************** TEST 'lld :: ELF/basic-sparcv9.s' FAILED ********************
Exit Code: 1

Command Output (stderr):
--
RUN: at line 2: /b/1/llvm-clang-x86_64-expensive-checks-debian/build/bin/llvm-mc -filetype=obj -triple=sparc64-unknown-openbsd /b/1/llvm-clang-x86_64-expensive-checks-debian/llvm-project/lld/test/ELF/basic-sparcv9.s -o /b/1/llvm-clang-x86_64-expensive-checks-debian/build/tools/lld/test/ELF/Output/basic-sparcv9.s.tmp
+ /b/1/llvm-clang-x86_64-expensive-checks-debian/build/bin/llvm-mc -filetype=obj -triple=sparc64-unknown-openbsd /b/1/llvm-clang-x86_64-expensive-checks-debian/llvm-project/lld/test/ELF/basic-sparcv9.s -o /b/1/llvm-clang-x86_64-expensive-checks-debian/build/tools/lld/test/ELF/Output/basic-sparcv9.s.tmp
RUN: at line 3: /b/1/llvm-clang-x86_64-expensive-checks-debian/build/bin/ld.lld /b/1/llvm-clang-x86_64-expensive-checks-debian/build/tools/lld/test/ELF/Output/basic-sparcv9.s.tmp -o /b/1/llvm-clang-x86_64-expensive-checks-debian/build/tools/lld/test/ELF/Output/basic-sparcv9.s.tmp2
+ /b/1/llvm-clang-x86_64-expensive-checks-debian/build/bin/ld.lld /b/1/llvm-clang-x86_64-expensive-checks-debian/build/tools/lld/test/ELF/Output/basic-sparcv9.s.tmp -o /b/1/llvm-clang-x86_64-expensive-checks-debian/build/tools/lld/test/ELF/Output/basic-sparcv9.s.tmp2
RUN: at line 4: /b/1/llvm-clang-x86_64-expensive-checks-debian/build/bin/llvm-readobj --file-headers --sections -l --symbols /b/1/llvm-clang-x86_64-expensive-checks-debian/build/tools/lld/test/ELF/Output/basic-sparcv9.s.tmp2    | /b/1/llvm-clang-x86_64-expensive-checks-debian/build/bin/FileCheck /b/1/llvm-clang-x86_64-expensive-checks-debian/llvm-project/lld/test/ELF/basic-sparcv9.s
+ /b/1/llvm-clang-x86_64-expensive-checks-debian/build/bin/llvm-readobj --file-headers --sections -l --symbols /b/1/llvm-clang-x86_64-expensive-checks-debian/build/tools/lld/test/ELF/Output/basic-sparcv9.s.tmp2
+ /b/1/llvm-clang-x86_64-expensive-checks-debian/build/bin/FileCheck /b/1/llvm-clang-x86_64-expensive-checks-debian/llvm-project/lld/test/ELF/basic-sparcv9.s
/b/1/llvm-clang-x86_64-expensive-checks-debian/llvm-project/lld/test/ELF/basic-sparcv9.s:20:15: error: CHECK-NEXT: expected string not found in input
# CHECK-NEXT: OS/ABI: SystemV (0x0)
              ^
<stdin>:12:16: note: scanning from here
 FileVersion: 1
               ^
<stdin>:13:2: note: possible intended match here
 OS/ABI: OpenBSD (0xC)
 ^

Input file: <stdin>
Check file: /b/1/llvm-clang-x86_64-expensive-checks-debian/llvm-project/lld/test/ELF/basic-sparcv9.s

-dump-input=help explains the following input dump.

Input was:
<<<<<<
           .
           .
           .
           7: ElfHeader { 
           8:  Ident { 
           9:  Magic: (7F 45 4C 46) 
          10:  Class: 64-bit (0x2) 
          11:  DataEncoding: BigEndian (0x2) 
          12:  FileVersion: 1 
next:20'0                    X error: no match found
          13:  OS/ABI: OpenBSD (0xC) 
next:20'0     ~~~~~~~~~~~~~~~~~~~~~~~
next:20'1      ?                      possible intended match
          14:  ABIVersion: 0 
next:20'0     ~~~~~~~~~~~~~~~
          15:  Unused: (00 00 00 00 00 00 00) 
next:20'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          16:  } 
next:20'0     ~~~
          17:  Type: Executable (0x2) 
next:20'0     ~~~~~~~~~~~~~~~~~~~~~~~~
...

@llvm-ci
Copy link
Collaborator

llvm-ci commented Jul 11, 2024

LLVM Buildbot has detected a new failure on builder llvm-x86_64-debian-dylib running on gribozavr4 while building llvm at step 8 "test-build-unified-tree-check-lld".

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:

Step 8 (test-build-unified-tree-check-lld) failure: test (failure)
******************** TEST 'lld :: ELF/basic-sparcv9.s' FAILED ********************
Exit Code: 1

Command Output (stderr):
--
RUN: at line 2: /b/1/llvm-x86_64-debian-dylib/build/bin/llvm-mc -filetype=obj -triple=sparc64-unknown-openbsd /b/1/llvm-x86_64-debian-dylib/llvm-project/lld/test/ELF/basic-sparcv9.s -o /b/1/llvm-x86_64-debian-dylib/build/tools/lld/test/ELF/Output/basic-sparcv9.s.tmp
+ /b/1/llvm-x86_64-debian-dylib/build/bin/llvm-mc -filetype=obj -triple=sparc64-unknown-openbsd /b/1/llvm-x86_64-debian-dylib/llvm-project/lld/test/ELF/basic-sparcv9.s -o /b/1/llvm-x86_64-debian-dylib/build/tools/lld/test/ELF/Output/basic-sparcv9.s.tmp
RUN: at line 3: /b/1/llvm-x86_64-debian-dylib/build/bin/ld.lld /b/1/llvm-x86_64-debian-dylib/build/tools/lld/test/ELF/Output/basic-sparcv9.s.tmp -o /b/1/llvm-x86_64-debian-dylib/build/tools/lld/test/ELF/Output/basic-sparcv9.s.tmp2
+ /b/1/llvm-x86_64-debian-dylib/build/bin/ld.lld /b/1/llvm-x86_64-debian-dylib/build/tools/lld/test/ELF/Output/basic-sparcv9.s.tmp -o /b/1/llvm-x86_64-debian-dylib/build/tools/lld/test/ELF/Output/basic-sparcv9.s.tmp2
RUN: at line 4: /b/1/llvm-x86_64-debian-dylib/build/bin/llvm-readobj --file-headers --sections -l --symbols /b/1/llvm-x86_64-debian-dylib/build/tools/lld/test/ELF/Output/basic-sparcv9.s.tmp2    | /b/1/llvm-x86_64-debian-dylib/build/bin/FileCheck /b/1/llvm-x86_64-debian-dylib/llvm-project/lld/test/ELF/basic-sparcv9.s
+ /b/1/llvm-x86_64-debian-dylib/build/bin/llvm-readobj --file-headers --sections -l --symbols /b/1/llvm-x86_64-debian-dylib/build/tools/lld/test/ELF/Output/basic-sparcv9.s.tmp2
+ /b/1/llvm-x86_64-debian-dylib/build/bin/FileCheck /b/1/llvm-x86_64-debian-dylib/llvm-project/lld/test/ELF/basic-sparcv9.s
/b/1/llvm-x86_64-debian-dylib/llvm-project/lld/test/ELF/basic-sparcv9.s:20:15: error: CHECK-NEXT: expected string not found in input
# CHECK-NEXT: OS/ABI: SystemV (0x0)
              ^
<stdin>:12:16: note: scanning from here
 FileVersion: 1
               ^
<stdin>:13:2: note: possible intended match here
 OS/ABI: OpenBSD (0xC)
 ^

Input file: <stdin>
Check file: /b/1/llvm-x86_64-debian-dylib/llvm-project/lld/test/ELF/basic-sparcv9.s

-dump-input=help explains the following input dump.

Input was:
<<<<<<
           .
           .
           .
           7: ElfHeader { 
           8:  Ident { 
           9:  Magic: (7F 45 4C 46) 
          10:  Class: 64-bit (0x2) 
          11:  DataEncoding: BigEndian (0x2) 
          12:  FileVersion: 1 
next:20'0                    X error: no match found
          13:  OS/ABI: OpenBSD (0xC) 
next:20'0     ~~~~~~~~~~~~~~~~~~~~~~~
next:20'1      ?                      possible intended match
          14:  ABIVersion: 0 
next:20'0     ~~~~~~~~~~~~~~~
          15:  Unused: (00 00 00 00 00 00 00) 
next:20'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          16:  } 
next:20'0     ~~~
          17:  Type: Executable (0x2) 
next:20'0     ~~~~~~~~~~~~~~~~~~~~~~~~
...

@joker-eph
Copy link
Collaborator

The failure is legit, unless there is a pending fix we should revert.

joker-eph added a commit that referenced this pull request Jul 11, 2024
joker-eph added a commit that referenced this pull request Jul 11, 2024
@Ericson2314
Copy link
Member Author

Sorry about that. So the failure broke lld/test/ELF/basic-sparcv9.s hmm OK.

Ericson2314 added a commit to obsidiansystems/llvm-project that referenced this pull request Jul 11, 2024
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.

(cherry picked from commit b64c1de)
@Ericson2314
Copy link
Member Author

#98553 is the next attempt.

Ericson2314 added a commit that referenced this pull request Jul 11, 2024
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.
Ericson2314 added a commit that referenced this pull request Jul 11, 2024
@llvm-ci
Copy link
Collaborator

llvm-ci commented Jul 12, 2024

LLVM Buildbot has detected a new failure on builder lld-x86_64-ubuntu-fast running on as-builder-4 while building llvm at step 6 "test-build-unified-tree-check-all".

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:

Step 6 (test-build-unified-tree-check-all) failure: test (failure)
******************** TEST 'lld :: ELF/basic-sparcv9.s' FAILED ********************
Exit Code: 1

Command Output (stderr):
--
RUN: at line 2: /home/buildbot/worker/as-builder-4/ramdisk/lld-x86_64/build/bin/llvm-mc -filetype=obj -triple=sparc64-unknown-openbsd /home/buildbot/worker/as-builder-4/ramdisk/lld-x86_64/llvm-project/lld/test/ELF/basic-sparcv9.s -o /home/buildbot/worker/as-builder-4/ramdisk/lld-x86_64/build/tools/lld/test/ELF/Output/basic-sparcv9.s.tmp
+ /home/buildbot/worker/as-builder-4/ramdisk/lld-x86_64/build/bin/llvm-mc -filetype=obj -triple=sparc64-unknown-openbsd /home/buildbot/worker/as-builder-4/ramdisk/lld-x86_64/llvm-project/lld/test/ELF/basic-sparcv9.s -o /home/buildbot/worker/as-builder-4/ramdisk/lld-x86_64/build/tools/lld/test/ELF/Output/basic-sparcv9.s.tmp
RUN: at line 3: /home/buildbot/worker/as-builder-4/ramdisk/lld-x86_64/build/bin/ld.lld /home/buildbot/worker/as-builder-4/ramdisk/lld-x86_64/build/tools/lld/test/ELF/Output/basic-sparcv9.s.tmp -o /home/buildbot/worker/as-builder-4/ramdisk/lld-x86_64/build/tools/lld/test/ELF/Output/basic-sparcv9.s.tmp2
+ /home/buildbot/worker/as-builder-4/ramdisk/lld-x86_64/build/bin/ld.lld /home/buildbot/worker/as-builder-4/ramdisk/lld-x86_64/build/tools/lld/test/ELF/Output/basic-sparcv9.s.tmp -o /home/buildbot/worker/as-builder-4/ramdisk/lld-x86_64/build/tools/lld/test/ELF/Output/basic-sparcv9.s.tmp2
RUN: at line 4: /home/buildbot/worker/as-builder-4/ramdisk/lld-x86_64/build/bin/llvm-readobj --file-headers --sections -l --symbols /home/buildbot/worker/as-builder-4/ramdisk/lld-x86_64/build/tools/lld/test/ELF/Output/basic-sparcv9.s.tmp2    | /home/buildbot/worker/as-builder-4/ramdisk/lld-x86_64/build/bin/FileCheck /home/buildbot/worker/as-builder-4/ramdisk/lld-x86_64/llvm-project/lld/test/ELF/basic-sparcv9.s
+ /home/buildbot/worker/as-builder-4/ramdisk/lld-x86_64/build/bin/llvm-readobj --file-headers --sections -l --symbols /home/buildbot/worker/as-builder-4/ramdisk/lld-x86_64/build/tools/lld/test/ELF/Output/basic-sparcv9.s.tmp2
+ /home/buildbot/worker/as-builder-4/ramdisk/lld-x86_64/build/bin/FileCheck /home/buildbot/worker/as-builder-4/ramdisk/lld-x86_64/llvm-project/lld/test/ELF/basic-sparcv9.s
/home/buildbot/worker/as-builder-4/ramdisk/lld-x86_64/llvm-project/lld/test/ELF/basic-sparcv9.s:20:15: error: CHECK-NEXT: expected string not found in input
# CHECK-NEXT: OS/ABI: SystemV (0x0)
              ^
<stdin>:12:16: note: scanning from here
 FileVersion: 1
               ^
<stdin>:13:2: note: possible intended match here
 OS/ABI: OpenBSD (0xC)
 ^

Input file: <stdin>
Check file: /home/buildbot/worker/as-builder-4/ramdisk/lld-x86_64/llvm-project/lld/test/ELF/basic-sparcv9.s

-dump-input=help explains the following input dump.

Input was:
<<<<<<
           .
           .
           .
           7: ElfHeader { 
           8:  Ident { 
           9:  Magic: (7F 45 4C 46) 
          10:  Class: 64-bit (0x2) 
          11:  DataEncoding: BigEndian (0x2) 
          12:  FileVersion: 1 
next:20'0                    X error: no match found
          13:  OS/ABI: OpenBSD (0xC) 
next:20'0     ~~~~~~~~~~~~~~~~~~~~~~~
next:20'1      ?                      possible intended match
          14:  ABIVersion: 0 
next:20'0     ~~~~~~~~~~~~~~~
          15:  Unused: (00 00 00 00 00 00 00) 
next:20'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          16:  } 
next:20'0     ~~~
          17:  Type: Executable (0x2) 
next:20'0     ~~~~~~~~~~~~~~~~~~~~~~~~
...

aaryanshukla pushed a commit to aaryanshukla/llvm-project that referenced this pull request Jul 14, 2024
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.
aaryanshukla pushed a commit to aaryanshukla/llvm-project that referenced this pull request Jul 14, 2024
aaryanshukla pushed a commit to aaryanshukla/llvm-project that referenced this pull request Jul 14, 2024
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
mc Machine (object) code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants