* strip.c (process_file): Open read-only when using a different output
file.
+2005-08-07 Roland McGrath <roland@redhat.com>
+
+ * strip.c (process_file): Open read-only when using a different output
+ file.
+
2005-08-06 Ulrich Drepper <drepper@redhat.com>
* elflint.c (in_nobits_scn): New function.
}
/* Open the file. */
- int fd = open (fname, O_RDWR);
+ int fd = open (fname, output_fname == NULL ? O_RDWR : O_RDONLY);
if (fd == -1)
{
error (0, errno, gettext ("while opening \"%s\""), fname);
}
/* Now get the ELF descriptor. */
- Elf *elf = elf_begin (fd, ELF_C_RDWR, NULL);
+ Elf *elf = elf_begin (fd, output_fname == NULL ? ELF_C_RDWR : ELF_C_READ,
+ NULL);
int result;
switch (elf_kind (elf))
{