This commit is contained in:
Rui Ueyama committed 2026-09-18 13:45:24 +09:00
1 parent e61c7dbcb7
commit 8ceae6875f
3 files changed
+13 -3

No files matched your search

+1 -1
View File
@@ -78,7 +78,7 @@ fn allocate_entries<T>(bufsize: usize) -> *mut Entry<T> {
let layout = Layout::from_size_align(bufsize, std::mem::align_of::<Entry<T>>())
.expect("invalid concurrent-map layout");
// SAFETY: the layout has nonzero size.
let entries = unsafe { alloc_zeroed(layout).cast() };
let entries = unsafe { alloc_zeroed(layout).cast::<Entry<T>>() };
if entries.is_null() {
panic!("cannot allocate {bufsize} bytes for concurrent map");
}
+11 -1
View File
@@ -60,7 +60,17 @@ fn encode_path(basedir: &OsStr, path: &Path) -> Vec<u8> {
let len = b" path=\n".len() + bytes.len();
let total = len + len.to_string().len();
let total = len + total.to_string().len();
let mut out = format!("{total} path=").into_bytes();
// PAX defines the `path` value as UTF-8. If a filename isn't valid
// UTF-8, we have to declare that we are storing raw bytes, or bsdtar
// (the tar of FreeBSD and macOS) fails to extract the archive. We
// don't declare it for every file because GNU tar doesn't know the
// keyword and prints a warning for each occurrence.
let mut out = Vec::new();
if path.to_str().is_none() {
out.extend_from_slice(b"21 hdrcharset=BINARY\n");
}
out.extend_from_slice(format!("{total} path=").as_bytes());
out.extend_from_slice(bytes);
out.push(b'\n');
out
+1 -1
View File
@@ -30,7 +30,7 @@ EOF
./mold -r -o $t/c.o $t/a.o $t/b.o
readelf -rW $t/c.o | sed -n '/\.rela\?\.eh_frame/,/^$/p' | grep '^0' |
readelf -rW $t/c.o | sed -nE '/\.rela?\.eh_frame/,/^$/p' | grep '^0' |
awk '{ print $1 }' > $t/log
sort -c $t/log