aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/MC/MCObjectFileInfo.cpp
diff options
context:
space:
mode:
authorSimonas Kazlauskas <git@kazlauskas.me>2021-02-16 13:35:32 -0800
committerDavid Blaikie <dblaikie@gmail.com>2021-02-16 13:38:35 -0800
commit6ffcb2937c96bd0d7a55b984b5eb8f381b68e322 (patch)
tree232f6532e794b8a4f717db206c18c73cb55e0116 /llvm/lib/MC/MCObjectFileInfo.cpp
parentf8af06d60d9c5bcf6104bf6540350fb0fb1d7ac5 (diff)
downloadllvm-6ffcb2937c96bd0d7a55b984b5eb8f381b68e322.zip
llvm-6ffcb2937c96bd0d7a55b984b5eb8f381b68e322.tar.gz
llvm-6ffcb2937c96bd0d7a55b984b5eb8f381b68e322.tar.bz2
[llvm-dwp] Join dwo paths correctly when DWOPath is absolute
When the `DWOPath` is absolute, we want to use `DWOPath` as is, without prepending any other components to the path. The `sys::path::append` does not join, but rather unconditionally appends the paths, so something like `sys::path::append("/tmp", "/tmp/banana")` will result in `/tmp/tmp/banana` rather than the desired `/tmp/banana`. This then causes `llvm-dwp` to fail in a following situation: ``` $ clang -gsplit-dwarf /tmp/banana/test.c -c -o /tmp/outdir/foo.o $ clang outdir/foo.o -o outdir/hm $ llvm-dwarfdump outdir/hm | grep -C2 foo.dwo DW_AT_comp_dir ("/tmp") DW_AT_GNU_pubnames (true) DW_AT_GNU_dwo_name ("/tmp/outdir/foo.dwo") DW_AT_GNU_dwo_id (0xde4d396f3bf0e257) DW_AT_low_pc (0x0000000000401100) $ strace -o trace llvm-dwp -e outdir/hm -o outdir/hm.dwp error: No such file or directory $ cat trace | grep foo.dwo openat(AT_FDCWD, "/tmp/tmp/outdir/foo.dwo", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) ``` Reviewed By: dblaikie Differential Revision: https://reviews.llvm.org/D96678
Diffstat (limited to 'llvm/lib/MC/MCObjectFileInfo.cpp')
0 files changed, 0 insertions, 0 deletions