diff options
| author | Ulf Hermann <[email protected]> | 2017-05-04 12:07:54 +0200 |
|---|---|---|
| committer | Ulf Hermann <[email protected]> | 2017-05-08 09:36:02 +0000 |
| commit | 0cfab8d6e47c165ee02d027c11b9a11c726516fa (patch) | |
| tree | 07868d226de62c4f9fd80ddb7882fe19151445b0 /libdwfl/link_map.c | |
| parent | 8ac52d75d47da355c4ace3224161de097db3e8d9 (diff) | |
Open files in O_BINARY
If O_BINARY is not defined, define it to 0, so that the change has no
effect then. Some systems have separate binary and text modes for files,
and we don't want the text mode to be used.
Change-Id: If7efb5bd448c2a1c7d1eb5dab276849b1b15a3ce
Reviewed-by: Christian Kandeler <[email protected]>
Diffstat (limited to 'libdwfl/link_map.c')
| -rw-r--r-- | libdwfl/link_map.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libdwfl/link_map.c b/libdwfl/link_map.c index 794668fc..4a50c441 100644 --- a/libdwfl/link_map.c +++ b/libdwfl/link_map.c @@ -393,7 +393,7 @@ report_r_debug (uint_fast8_t elfclass, uint_fast8_t elfdata, { /* This code is mostly inlined dwfl_report_elf. */ // XXX hook for sysroot - int fd = open (name, O_RDONLY); + int fd = open (name, O_RDONLY | O_BINARY); if (fd >= 0) { Elf *elf; @@ -808,7 +808,7 @@ dwfl_link_map_report (Dwfl *dwfl, const void *auxv, size_t auxv_size, EXECUTABLE_FOR_CORE to find where DYNAMIC is located in the core file. */ - int fd = open (dwfl->user_core->executable_for_core, O_RDONLY); + int fd = open (dwfl->user_core->executable_for_core, O_RDONLY | O_BINARY); Elf *elf; Dwfl_Error error = DWFL_E_ERRNO; if (fd != -1) |
