[libc][realpath] Follow symlinks
This commit updates realpath to call readlinkat on symlinks during path resolution. In order to do, it updates `PendingPath` to store a `cpp::string` that is prepended with a symlink target when resolved. This could be more efficient by using a `PATH_MAX` buffer and storing the path at the end of the buffer, but using a `cpp::string` avoids the pointer arithmetic and manual memory management that comes with that approach.
[libc][realpath] Follow symlinks
This commit updates realpath to call readlinkat on symlinks during path resolution. In order to do, it updates `PendingPath` to store a `cpp::string` that is prepended with a symlink target when resolved. This could be more efficient by using a `PATH_MAX` buffer and storing the path at the end of the buffer, but using a `cpp::string` avoids the pointer arithmetic and manual memory management that comes with that approach.
[mlir][arith] Fold trivial shifts (`0<<x`, `x>>x`, `-1>>x`) (#212159)
Add value-preserving folds mirroring LLVM's InstructionSimplify for the
integer shift ops:
```
shli/shrui/shrsi(0, x) -> 0
shrui/shrsi(x, x) -> 0
shrsi(-1, x) -> -1
```
A shift amount greater than or equal to the bit width yields poison, so
refining these cases to a constant is valid. For `shr(x, x)` any
in-range amount `v` satisfies `v >> v == 0 (v < 2^v)`.
Folding an out-of-range shift amount (`c >= bit width`) to poison is
left as a TODO: it would make the arith dialect depend on the ub dialect
to materialize `ub.poison`.
[17 lines not shown]
[RISCV] Declare TLSDESC clobbers for vector registers and CSRs per psABI (#205027)
RISC-V's ABI states that, aside from V extension state, only a0 and t0
are clobbered by TLSDESC resolvers. The original specification was to
also not clobber any V extension state, but due to implementation
concerns an ABI-breaking change has been made[1] to clobber all V
extension state.
This patch adds V-regs/csrs clobbering to the existing PseudoLA_TLSDESC
and PseudoTLSDESCCall in RISCVInstrInfo.td, as well as an additional
test covering the V-register clobber and V-CSRs clobber cases.
[1] https://github.com/riscv-non-isa/riscv-elf-psabi-doc/pull/496
[libc][realpath] Follow symlinks
This commit updates realpath to call readlinkat on symlinks during path resolution. In order to do, it updates `PendingPath` to store a `cpp::string` that is prepended with a symlink target when resolved. This could be more efficient by using a `PATH_MAX` buffer and storing the path at the end of the buffer, but using a `cpp::string` avoids the pointer arithmetic and manual memory management that comes with that approach.
drm/radeon: fix integer overflow in radeon_align_pitch()
From Werner Kasselman
d9dfa176899d488e48bb7342d2c43ddd36e66318 in linux-6.18.y/6.18.40
ce3b24eb3ee8f82de851535f516bf21f83e82259 in mainline linux
drm/amdgpu: fix integer overflow in amdgpu_gem_align_pitch()
From Werner Kasselman
daf5d03ddb8ccbe4a9bf22b320de049d2f17a3d1 in linux-6.18.y/6.18.40
fc3659f178d4a65599167d5a648bbeef4b0d4446 in mainline linux
drm/gpuvm: Do not prepare NULL objects
From Jonathan Cavitt
41a60487b5b04e036024c2698f001f45ff250185 in linux-6.18.y/6.18.40
88f059f6f6f589bd78e2ceb05a1339a8c10b8626 in mainline linux
drm/gpusvm: Reject VMAs with VM_IO or VM_PFNMAP when creating SVM ranges
From Matthew Brost
353f26c74660bcbd8d82cd76622748e14a5a5db3 in linux-6.18.y/6.18.40
b82a225e57a334335a21462b75ee2223bc6efe6d in mainline linux
[ELF,SPARC] Add the GOT header entry and place R_SPARC_JMP_SLOT in .plt (#212161)
SPARC dynamic linker finds _DYNAMIC by dereferencing the GOT pointer
register (glibc elf_machine_dynamic), so reserve .got[0] for it. It
resolves a PLT entry by rewriting the entry's instructions (glibc
sparc64_fixup_plt), so R_SPARC_JMP_SLOT applies to .plt and there is no
.got.plt.
Add TargetInfo::usesGotPlt, which SPARC sets to false, and use it to
place the relocation and derive the sh_info of .rela.plt. The four
reserved PLT entries stay zeroed, as with GNU ld; the dynamic linker
fills in .PLT0 and .PLT1 at startup.
Co-authored-by: Kirill A. Korinsky <kirill at korins.ky>
Co-authored-by: LemonBoy <thatlemon at gmail.com>
Stop mutating the initial LookupResult, and instead use an optional buffer
for the MSVC fallback.
The refactoring actually removed the need for a the old "did we try type
aware allocators", and a few other things also got cleaned up.
[clangd] Respect ArgumentLists for struct templates (#212094)
Also fix a bug in index::getSymbolKind where the returned symbol kind
would be Class for a struct template.
Fixes https://github.com/clangd/clangd/issues/2684
[LoongArch] Simplify addReloc relocation handling. NFC (#211755)
Remove the unused return value of addReloc and simplify the control
flow for linker relaxation and PC-relative relocation handling.