-
Notifications
You must be signed in to change notification settings - Fork 493
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Integrate LLVM at llvm/llvm-project@9df19ce40281
Updates LLVM usage to match [9df19ce40281](llvm/llvm-project@9df19ce40281) PiperOrigin-RevId: 621676170
- Loading branch information
1 parent
7b4b275
commit baf7544
Showing
4 changed files
with
482 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,240 @@ | ||
Auto generated patch. Do not edit or delete it, even if empty. | ||
diff -ruN --strip-trailing-cr a/lld/ELF/SyntheticSections.cpp b/lld/ELF/SyntheticSections.cpp | ||
--- a/lld/ELF/SyntheticSections.cpp | ||
+++ b/lld/ELF/SyntheticSections.cpp | ||
@@ -1633,7 +1633,8 @@ | ||
return; | ||
const RelType relativeRel = target->relativeRel; | ||
numRelativeRelocs = | ||
- llvm::partition(relocs, [=](auto &r) { return r.type == relativeRel; }) - | ||
+ std::stable_partition(relocs.begin(), relocs.end(), | ||
+ [=](auto &r) { return r.type == relativeRel; }) - | ||
relocs.begin(); | ||
} | ||
|
||
@@ -1666,7 +1667,7 @@ | ||
parallelForEach(relocs, | ||
[symTab](DynamicReloc &rel) { rel.computeRaw(symTab); }); | ||
|
||
- auto irelative = std::partition( | ||
+ auto irelative = std::stable_partition( | ||
relocs.begin() + numRelativeRelocs, relocs.end(), | ||
[t = target->iRelativeRel](auto &r) { return r.type != t; }); | ||
|
||
diff -ruN --strip-trailing-cr a/lld/test/ELF/gnu-ifunc-nonpreemptible.s b/lld/test/ELF/gnu-ifunc-nonpreemptible.s | ||
--- a/lld/test/ELF/gnu-ifunc-nonpreemptible.s | ||
+++ b/lld/test/ELF/gnu-ifunc-nonpreemptible.s | ||
@@ -1,62 +1,76 @@ | ||
# REQUIRES: x86 | ||
-# RUN: llvm-mc -filetype=obj -triple=x86_64 %s -o %t.o | ||
-# RUN: ld.lld %t.o -o %t | ||
-# RUN: llvm-objdump --no-print-imm-hex -d --no-show-raw-insn %t | FileCheck %s --check-prefix=DISASM | ||
-# RUN: llvm-readelf -r -s %t | FileCheck %s | ||
+# RUN: rm -rf %t && split-file %s %t && cd %t | ||
+# RUN: llvm-mc -filetype=obj -triple=x86_64 a.s -o a.o | ||
+# RUN: llvm-mc -filetype=obj -triple=x86_64 b.s -o b.o | ||
+# RUN: ld.lld -shared -soname=b.so b.o -o b.so | ||
+ | ||
+# RUN: ld.lld a.o -o a | ||
+# RUN: llvm-objdump --no-print-imm-hex -d --no-show-raw-insn a | FileCheck %s --check-prefix=DISASM | ||
+# RUN: llvm-readelf -r -s a | FileCheck %s | ||
|
||
-# RUN: ld.lld --export-dynamic %t.o -o %t | ||
-# RUN: llvm-readelf -r -s %t | FileCheck %s | ||
- | ||
-# CHECK: Relocation section '.rela.dyn' at offset {{.*}} contains 2 entries: | ||
+# CHECK: Relocation section '.rela.dyn' at offset {{.*}} contains 3 entries: | ||
# CHECK-NEXT: Type | ||
-# CHECK-NEXT: R_X86_64_IRELATIVE | ||
-# CHECK-NEXT: R_X86_64_IRELATIVE | ||
- | ||
-# CHECK: 0 NOTYPE LOCAL HIDDEN [[#]] __rela_iplt_start | ||
-# CHECK-NEXT: 0 NOTYPE LOCAL HIDDEN [[#]] __rela_iplt_end | ||
- | ||
-# RUN: ld.lld -pie %t.o -o %t1 | ||
-# RUN: llvm-readelf -s %t1 | FileCheck %s --check-prefix=PIC | ||
-# RUN: ld.lld -shared %t.o -o %t2 | ||
-# RUN: llvm-readelf -s %t2 | FileCheck %s --check-prefix=PIC | ||
+# CHECK-NEXT: {{0*}}[[#%x,O:]] [[#%x,]] R_X86_64_IRELATIVE [[#%x,QUX:]] | ||
+# CHECK-NEXT: {{0*}}[[#O+8]] [[#%x,]] R_X86_64_IRELATIVE | ||
+# CHECK-NEXT: {{0*}}[[#O+16]] [[#%x,]] R_X86_64_IRELATIVE | ||
+ | ||
+# CHECK: 0 NOTYPE LOCAL HIDDEN [[#]] __rela_iplt_start | ||
+# CHECK-NEXT: 0 NOTYPE LOCAL HIDDEN [[#]] __rela_iplt_end | ||
+# CHECK-NEXT: {{0*}}[[#QUX]] 0 IFUNC GLOBAL DEFAULT [[#]] qux | ||
+ | ||
+# RUN: ld.lld -pie a.o b.so -o a1 | ||
+# RUN: llvm-readelf -rs a1 | FileCheck %s --check-prefixes=PIC,PIE | ||
+# RUN: ld.lld -shared a.o b.so -o a2 | ||
+# RUN: llvm-readelf -rs a2 | FileCheck %s --check-prefix=PIC | ||
+ | ||
+# PIC: {{0*}}[[#%x,O:]] [[#%x,]] R_X86_64_RELATIVE | ||
+# PIC-NEXT: R_X86_64_GLOB_DAT 0000000000000000 ext + 0 | ||
+# PIC-NEXT: {{0*}}[[#O-16]] [[#%x,]] R_X86_64_64 0000000000000000 __rela_iplt_start + 0 | ||
+# PIC-NEXT: {{0*}}[[#O-8]] [[#%x,]] R_X86_64_64 0000000000000000 __rela_iplt_end + 0 | ||
+# PIE-NEXT: {{0*}}[[#O+8]] [[#%x,]] R_X86_64_IRELATIVE | ||
+# PIE-NEXT: {{0*}}[[#O+16]] [[#%x,]] R_X86_64_IRELATIVE | ||
+# PIE-NEXT: {{0*}}[[#O+24]] [[#%x,]] R_X86_64_IRELATIVE | ||
|
||
# PIC: 0 NOTYPE WEAK DEFAULT UND __rela_iplt_start | ||
# PIC-NEXT: 0 NOTYPE WEAK DEFAULT UND __rela_iplt_end | ||
|
||
# DISASM: Disassembly of section .text: | ||
# DISASM-EMPTY: | ||
-# DISASM-NEXT: <foo>: | ||
+# DISASM-NEXT: <qux>: | ||
+# DISASM: <foo>: | ||
# DISASM: <bar>: | ||
# DISASM: <unused>: | ||
# DISASM: <_start>: | ||
# DISASM-NEXT: callq 0x[[#%x,foo:]] | ||
# DISASM-NEXT: callq 0x[[#%x,bar:]] | ||
+# DISASM-NEXT: callq 0x[[#%x,qux:]] | ||
# DISASM-EMPTY: | ||
# DISASM-NEXT: Disassembly of section .iplt: | ||
# DISASM-EMPTY: | ||
# DISASM-NEXT: <.iplt>: | ||
-# DISASM-NEXT: [[#foo]]: jmpq *{{.*}}(%rip) | ||
+# DISASM-NEXT: [[#qux]]: jmpq *{{.*}}(%rip) | ||
# DISASM-NEXT: pushq $0 | ||
# DISASM-NEXT: jmp 0x0 | ||
-# DISASM-NEXT: [[#bar]]: jmpq *{{.*}}(%rip) | ||
+# DISASM-NEXT: [[#foo]]: jmpq *{{.*}}(%rip) | ||
# DISASM-NEXT: pushq $1 | ||
# DISASM-NEXT: jmp 0x0 | ||
+# DISASM-NEXT: [[#bar]]: jmpq *{{.*}}(%rip) | ||
+# DISASM-NEXT: pushq $2 | ||
+# DISASM-NEXT: jmp 0x0 | ||
|
||
-.text | ||
+#--- a.s | ||
+.globl qux, foo, bar | ||
+.type qux, @gnu_indirect_function | ||
.type foo STT_GNU_IFUNC | ||
-.globl foo | ||
-foo: | ||
- ret | ||
- | ||
.type bar STT_GNU_IFUNC | ||
-.globl bar | ||
-bar: | ||
- ret | ||
+qux: ret | ||
+foo: ret | ||
+bar: ret | ||
|
||
.type unused, @gnu_indirect_function | ||
.globl unused | ||
-unused: | ||
- ret | ||
+.weak ext | ||
+unused: mov ext@gotpcrel(%rip), %rax | ||
|
||
.weak __rela_iplt_start | ||
.weak __rela_iplt_end | ||
@@ -65,7 +79,14 @@ | ||
_start: | ||
call foo | ||
call bar | ||
+ call qux | ||
|
||
.data | ||
.quad __rela_iplt_start | ||
.quad __rela_iplt_end | ||
+ .quad .data | ||
+ | ||
+#--- b.s | ||
+.globl ext | ||
+ext: | ||
+ ret | ||
diff -ruN --strip-trailing-cr a/lld/test/ELF/gnu-ifunc-relative.s b/lld/test/ELF/gnu-ifunc-relative.s | ||
--- a/lld/test/ELF/gnu-ifunc-relative.s | ||
+++ b/lld/test/ELF/gnu-ifunc-relative.s | ||
@@ -1,25 +0,0 @@ | ||
-// REQUIRES: x86 | ||
-// RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t.o | ||
-// RUN: ld.lld --strip-all %t.o -o %t | ||
-// RUN: llvm-readobj -r %t | FileCheck %s | ||
-// RUN: ld.lld %t.o -o %t | ||
-// RUN: llvm-readobj -r --symbols %t | FileCheck %s --check-prefixes=CHECK,SYM | ||
- | ||
-.type foo STT_GNU_IFUNC | ||
-.globl foo | ||
-foo: | ||
- ret | ||
- | ||
-.globl _start | ||
-_start: | ||
- call foo | ||
- | ||
-// CHECK: Section ({{.*}}) .rela.dyn { | ||
-// CHECK-NEXT: R_X86_64_IRELATIVE - 0x[[ADDR:.*]] | ||
-// CHECK-NEXT: } | ||
- | ||
-// SYM: Name: foo | ||
-// SYM-NEXT: Value: 0x[[ADDR]] | ||
-// SYM-NEXT: Size: 0 | ||
-// SYM-NEXT: Binding: Global | ||
-// SYM-NEXT: Type: GNU_IFunc | ||
diff -ruN --strip-trailing-cr a/llvm/include/llvm/ADT/iterator_range.h b/llvm/include/llvm/ADT/iterator_range.h | ||
--- a/llvm/include/llvm/ADT/iterator_range.h | ||
+++ b/llvm/include/llvm/ADT/iterator_range.h | ||
@@ -48,9 +48,10 @@ | ||
// See https://github.com/llvm/llvm-project/issues/63843 | ||
template <typename Container> | ||
#else | ||
- template <typename Container, | ||
- std::enable_if_t<explicitly_convertible< | ||
- detail::IterOfRange<Container>, IteratorT>::value> * = nullptr> | ||
+ template < | ||
+ typename Container, | ||
+ std::enable_if_t<explicitly_convertible< | ||
+ llvm::detail::IterOfRange<Container>, IteratorT>::value> * = nullptr> | ||
#endif | ||
iterator_range(Container &&c) | ||
: begin_iterator(adl_begin(c)), end_iterator(adl_end(c)) { | ||
@@ -65,7 +66,8 @@ | ||
}; | ||
|
||
template <typename Container> | ||
-iterator_range(Container &&) -> iterator_range<detail::IterOfRange<Container>>; | ||
+iterator_range(Container &&) | ||
+ -> iterator_range<llvm::detail::IterOfRange<Container>>; | ||
|
||
/// Convenience function for iterating over sub-ranges. | ||
/// | ||
diff -ruN --strip-trailing-cr a/mlir/include/mlir/IR/OwningOpRef.h b/mlir/include/mlir/IR/OwningOpRef.h | ||
--- a/mlir/include/mlir/IR/OwningOpRef.h | ||
+++ b/mlir/include/mlir/IR/OwningOpRef.h | ||
@@ -13,6 +13,7 @@ | ||
#ifndef MLIR_IR_OWNINGOPREF_H | ||
#define MLIR_IR_OWNINGOPREF_H | ||
|
||
+#include <type_traits> | ||
#include <utility> | ||
|
||
namespace mlir { | ||
diff -ruN --strip-trailing-cr a/utils/bazel/llvm-project-overlay/libc/libc_build_rules.bzl b/utils/bazel/llvm-project-overlay/libc/libc_build_rules.bzl | ||
--- a/utils/bazel/llvm-project-overlay/libc/libc_build_rules.bzl | ||
+++ b/utils/bazel/llvm-project-overlay/libc/libc_build_rules.bzl | ||
@@ -78,6 +78,7 @@ | ||
its deps. | ||
**kwargs: Other attributes relevant for a cc_library. For example, deps. | ||
""" | ||
+ | ||
# We use the explicit equals pattern here because append and += mutate the | ||
# original list, where this creates a new list and stores it in deps. | ||
copts = copts or [] | ||
@@ -89,10 +90,11 @@ | ||
"-fno-omit-frame-pointer", | ||
"-fstack-protector-strong", | ||
] | ||
+ | ||
# x86 targets have -mno-omit-leaf-frame-pointer. | ||
platform_copts = selects.with_or({ | ||
PLATFORM_CPU_X86_64: ["-mno-omit-leaf-frame-pointer"], | ||
- "//conditions:default": [] | ||
+ "//conditions:default": [], | ||
}) | ||
copts = copts + platform_copts | ||
|
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
Oops, something went wrong.