[ELF] Replace getThreadIndex with explicit shards in RelocScan. NFC (#208959)
Parallel relocation scanning (https://reviews.llvm.org/D133003) appends
dynamic relocations to `relocsVec[parallel::getThreadIndex()]`.
`getThreadIndex` returns -1u on main, which is a known hazard.
Instead, run one scan task per worker via `parallelFor`, with tasks
claiming object files off a shared counter, and pass the task index
through scanSection/RelocScan as the relocsVec shard.
renameat(2): add AT_RENAME_EXCHANGE flag
Currently no filesystems support it.
Reviewed by: mckusick
Discussed with: markj
Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D57658
[ELF] Fix data race when handleTlsIe adds a RELATIVE relocation (#208956)
The ieExpr == R_GOT PIC case (e.g. R_386_TLS_IE in -shared links) calls
the unsynchronized addRelativeReloc from concurrent scanSectionImpl
tasks, racing on relaDyn->relativeRelocs. Use the sharded variant like
processAux. Split i386-tls-ie-shared.s into two input files so that a
ThreadSanitizer build detects the race.
unit/sha2: test SHA-256, SHA-512 and SHA-512/256
NIST known answers, split updates across the 64- and 128-byte block
boundaries, and cross-implementation equality via zfs_impl_get_ops().
Check SHA-256 and SHA-512 against the one-million-'a' digests based
on the NIST standard.
Reviewed-by: Tino Reichardt <milky-zfs at mcmilk.de>
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Christos Longros <chris.longros at gmail.com>
Closes #18779
zonectl: display conventional zones better during RZ
zonectl's Report Zones subcommand displays a tabular list of zones. A
conventional zone's WP column is displayed as 0xffffffffffffffff , the
literal value that the HDD reports. But that's too wide for the column,
causing the text to be misaligned. It's also not really meaningful,
because the Write Pointer isn't really defined for a Conventional zone.
Change it to "-1" to fix the text misalignment.
MFC after: 2 weeks
Sponsored by: ConnectWise
Reviewed by: fuz
Differential Revision: https://reviews.freebsd.org/D57512