diff options
| author | Ulf Hermann <[email protected]> | 2017-04-06 15:14:09 +0200 |
|---|---|---|
| committer | Ulf Hermann <[email protected]> | 2017-05-08 09:45:39 +0000 |
| commit | e5cde7378c246a32d7dbc3bff8db15befad8b1a9 (patch) | |
| tree | 7586f1b4901236f1dbe28e022d6a4c9b84bef74e /src | |
| parent | 037d971fa81644af1d3be30db409309155fda721 (diff) | |
Use OS-specific paths
In general we need to use ';' as path separator and '\' and directory
separator on windows. The shell will automatically translate paths to
some extent, but we have to call "pwd -W" rather than plain "pwd" to
get something useful.
Change-Id: I1a117d219a2aa00c1f77ae7d3a1d92b9bae526db
Reviewed-by: Christian Kandeler <[email protected]>
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 6 | ||||
| -rw-r--r-- | src/addr2line.c | 4 | ||||
| -rw-r--r-- | src/size.c | 4 | ||||
| -rw-r--r-- | src/strip.c | 4 |
4 files changed, 12 insertions, 6 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 7103770c..0d1e57d7 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,11 @@ 2017-05-04 Ulf Hermann <[email protected]> + * addr2line.c: Don't assume unix file system conventions. + * size.c: Likewise. + * strip.c: Likewise. + +2017-05-04 Ulf Hermann <[email protected]> + * ar.c: Open files in O_BINARY. * elfcmp.c: Likewise. * elfcompress.c: Likewise. diff --git a/src/addr2line.c b/src/addr2line.c index ba414a74..7ee9fcfc 100644 --- a/src/addr2line.c +++ b/src/addr2line.c @@ -375,7 +375,7 @@ print_dwarf_function (Dwfl_Module *mod, Dwarf_Addr addr) file = "???"; else if (only_basenames) file = basename (file); - else if (use_comp_dir && file[0] != '/') + else if (use_comp_dir && !IS_ABSOLUTE_PATH(file)) { const char *const *dirs; size_t ndirs; @@ -559,7 +559,7 @@ print_src (const char *src, int lineno, int linecol, Dwarf_Die *cu) if (only_basenames) src = basename (src); - else if (use_comp_dir && src[0] != '/') + else if (use_comp_dir && !IS_ABSOLUTE_PATH(src)) { Dwarf_Attribute attr; comp_dir = dwarf_formstring (dwarf_attr (cu, DW_AT_comp_dir, &attr)); @@ -350,7 +350,7 @@ handle_ar (int fd, Elf *elf, const char *prefix, const char *fname) if (prefix != NULL) { cp = mempcpy (cp, prefix, prefix_len); - *cp++ = ':'; + *cp++ = PATHSEP; } memcpy (cp, fname, fname_len); @@ -635,7 +635,7 @@ handle_elf (Elf *elf, const char *prefix, const char *fname) if (prefix != NULL) { cp = mempcpy (cp, prefix, prefix_len); - *cp++ = ':'; + *cp++ = PATHSEP; } memcpy (cp, fname, fname_len); diff --git a/src/strip.c b/src/strip.c index db8ff2f5..60f6700e 100644 --- a/src/strip.c +++ b/src/strip.c @@ -440,7 +440,7 @@ handle_elf (int fd, Elf *elf, const char *prefix, const char *fname, if (prefix != NULL) { cp = mempcpy (cp, prefix, prefix_len); - *cp++ = ':'; + *cp++ = PATHSEP; } memcpy (cp, fname, fname_len); @@ -2263,7 +2263,7 @@ handle_ar (int fd, Elf *elf, const char *prefix, const char *fname, if (prefix != NULL) { cp = mempcpy (cp, prefix, prefix_len); - *cp++ = ':'; + *cp++ = PATHSEP; } memcpy (cp, fname, fname_len); |
