forked from llvm/llvm-project
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[X86] Fix RTTI proxy emission for 32-bit (llvm#78622)
32-bit x86 doesn't have an appropriate relocation type we can use to elide the RTTI proxies, so we need to emit them. This would previously cause crashes when using the relative vtable ABI for 32-bit x86.
- Loading branch information
Showing
4 changed files
with
33 additions
and
4 deletions.
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
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 |
---|---|---|
@@ -0,0 +1,20 @@ | ||
; REQUIRES: x86-registered-target | ||
|
||
;; Validate that we produce RTTI proxies for 32-bit x86. | ||
; RUN: llc %s -mtriple=i686-elf -o - | FileCheck %s | ||
|
||
;; Validate that we produce a valid object file. | ||
; RUN: llc %s -mtriple=i686-elf --filetype=obj -o %t.o | ||
; RUN: llvm-readobj --relocs %t.o | FileCheck --check-prefix=RELOCS %s | ||
|
||
@vtable = dso_local unnamed_addr constant i32 trunc (i64 sub (i64 ptrtoint (ptr @rtti.proxy to i64), i64 ptrtoint (ptr @vtable to i64)) to i32), align 4 | ||
@rtti = external global i8, align 8 | ||
@rtti.proxy = linkonce_odr hidden unnamed_addr constant ptr @rtti | ||
|
||
; CHECK-LABEL: vtable: | ||
; CHECK-NEXT: .long rtti.proxy-vtable | ||
|
||
; CHECK-LABEL: rtti.proxy: | ||
; CHECK-NEXT: .long rtti | ||
|
||
; RELOCS: R_386_32 rtti |