Mail Archives: djgpp-workers/1999/08/01/10:02:57
These are the patches for the bfd subdirectory.
1999-07-31 Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
* archive.c (normalize, bfd_bsd_truncate_arname,
bfd_gnu_truncate_arname) [DOSISH_FILENAMES]: Support file names
with backslashes.
* cache.c (bfd_open_file) [__MSDOS__]: Don't unlink the file
before opening it.
1999-07-06 Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
* aoutx.h (NAME(aout,find_nearest_line)): Use IS_ABSOLUTE.
* sysdep.h: Include filenames.h (from include/ directory).
*** bfd/archive.c1~ Fri May 1 18:48:00 1998
--- bfd/archive.c Sat Jul 31 12:31:02 1999
*************** normalize (abfd, file)
*** 1181,1186 ****
--- 1181,1196 ----
{
const char *filename = strrchr (file, '/');
+
+ #ifdef DOSISH_FILENAMES
+ /* We could have foo/bar\\baz, or foo\\bar, or d:bar. */
+ if (filename == (char *) NULL || strchr (filename, '\\'))
+ {
+ filename = strrchr (filename != (char *) NULL ? filename : file, '\\');
+ if (filename == (char *) NULL && *file && file[1] == ':')
+ filename = file + 1;
+ }
+ #endif
if (filename != (char *) NULL)
filename++;
else
*************** bfd_bsd_truncate_arname (abfd, pathname,
*** 1493,1498 ****
--- 1503,1518 ----
CONST char *filename = strrchr (pathname, '/');
int maxlen = ar_maxnamelen (abfd);
+ #ifdef DOSISH_FILENAMES
+ /* We could have foo/bar\\baz, or foo\\bar, or d:bar. */
+ if (!filename || strchr (filename, '\\'))
+ {
+ filename = strrchr (filename ? filename : pathname, '\\');
+ if (!filename && *pathname && pathname[1] == ':')
+ filename = pathname + 1;
+ }
+ #endif
+
if (filename == NULL)
filename = pathname;
else
*************** bfd_gnu_truncate_arname (abfd, pathname,
*** 1533,1538 ****
--- 1553,1568 ----
CONST char *filename = strrchr (pathname, '/');
int maxlen = ar_maxnamelen (abfd);
+ #ifdef DOSISH_FILENAMES
+ /* We could have foo/bar\\baz, or foo\\bar, or d:bar. */
+ if (!filename || strchr (filename, '\\'))
+ {
+ filename = strrchr (filename ? filename : pathname, '\\');
+ if (!filename && *pathname && pathname[1] == ':')
+ filename = pathname + 1;
+ }
+ #endif
+
if (filename == NULL)
filename = pathname;
else
*** bfd/cache.c~ Fri May 1 18:48:00 1998
--- bfd/cache.c Sat Jul 31 16:32:14 1999
*************** bfd_open_file (abfd)
*** 288,294 ****
--- 288,301 ----
/* Create the file. Unlink it first, for the convenience of
operating systems which worry about overwriting running
binaries. */
+ #ifndef __MSDOS__
+ /* Don't do this for MSDOS: it doesn't care about overwriting
+ a running binary, but if this file is already open by
+ another BFD, we will be in deep trouble if we delete an
+ open file. In fact, objdump does just that if invoked with
+ the --info option. */
unlink (abfd->filename);
+ #endif
abfd->iostream = (PTR) fopen (abfd->filename, FOPEN_WB);
abfd->opened_once = true;
}
*** bfd/sysdep.h~0 Fri May 1 18:48:14 1998
--- bfd/sysdep.h Tue Jul 6 15:41:48 1999
***************
*** 102,107 ****
--- 102,109 ----
#define SEEK_CUR 1
#endif
+ #include "filenames.h"
+
#ifdef NEED_DECLARATION_STRSTR
extern char *strstr ();
#endif
*** bfd/aoutx.h~0 Fri May 1 18:48:00 1998
--- bfd/aoutx.h Tue Jul 6 15:44:00 1999
*************** NAME(aout,find_nearest_line)
*** 2790,2796 ****
main_file_name = line_file_name;
if (main_file_name == NULL
! || main_file_name[0] == '/'
|| directory_name == NULL)
filelen = 0;
else
--- 2790,2796 ----
main_file_name = line_file_name;
if (main_file_name == NULL
! || IS_ABSOLUTE (main_file_name)
|| directory_name == NULL)
filelen = 0;
else
*************** NAME(aout,find_nearest_line)
*** 2814,2820 ****
if (main_file_name != NULL)
{
! if (main_file_name[0] == '/' || directory_name == NULL)
*filename_ptr = main_file_name;
else
{
--- 2814,2820 ----
if (main_file_name != NULL)
{
! if (IS_ABSOLUTE (main_file_name) || directory_name == NULL)
*filename_ptr = main_file_name;
else
{
- Raw text -