From: David O'Brien Date: Fri, 20 Jul 2001 02:22:18 +0000 (+0000) Subject: 2001-07-19 David O'Brien X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=1237740c4dae5fa3d90df4a98a130cf2b86dd0a1;p=thirdparty%2Fbinutils-gdb.git 2001-07-19 David O'Brien * lbasename.c: New file. * libiberty.h: Add lbasename. Approved by: Philip Blundell * emultempl/elf32.em: Do not assuming that contents of the buffer returned from basename function will remain unchanged accross other function calls. Approved by: Philip Blundell --- diff --git a/include/ChangeLog b/include/ChangeLog index 10bb1b2a86b..ad96520e28f 100644 --- a/include/ChangeLog +++ b/include/ChangeLog @@ -1,3 +1,7 @@ +2001-07-19 David O'Brien + + * libiberty.h: Add lbasename. + 2001-06-07 Alan Modra * Many files: Update copyright notices. diff --git a/include/libiberty.h b/include/libiberty.h index 1bc2b7d403b..d31ac777dd4 100644 --- a/include/libiberty.h +++ b/include/libiberty.h @@ -81,6 +81,10 @@ extern char *basename (); # endif #endif +/* A well-defined basename () that is always compiled in. */ + +extern char *lbasename PARAMS ((const char *)); + /* Concatenate an arbitrary number of strings, up to (char *) NULL. Allocates memory using xmalloc. */ diff --git a/ld/ChangeLog b/ld/ChangeLog index 54a9aa5c301..df9f3c5f54b 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,3 +1,9 @@ +2001-07-19 David O'Brien + + * emultempl/elf32.em: Do not assuming that contents of the buffer + returned from basename function will remain unchanged accross other + function calls. + 2001-07-19 Nick Clifton * ldlang.c (lang_leave_overlay): If a region is specified assign diff --git a/ld/emultempl/elf32.em b/ld/emultempl/elf32.em index c0d52b10205..76aaa8a66cc 100644 --- a/ld/emultempl/elf32.em +++ b/ld/emultempl/elf32.em @@ -142,7 +142,7 @@ gld${EMULATION_NAME}_vercheck (s) soname = bfd_elf_get_dt_soname (s->the_bfd); if (soname == NULL) - soname = basename (bfd_get_filename (s->the_bfd)); + soname = lbasename (bfd_get_filename (s->the_bfd)); for (l = global_vercheck_needed; l != NULL; l = l->next) { @@ -224,7 +224,7 @@ gld${EMULATION_NAME}_stat_needed (s) soname = bfd_elf_get_dt_soname (s->the_bfd); if (soname == NULL) - soname = basename (s->filename); + soname = lbasename (s->filename); if (strncmp (soname, global_needed->name, suffix - global_needed->name) == 0) @@ -329,7 +329,7 @@ cat >>e${EMULATION_NAME}.c <filename); + soname = lbasename (abfd->filename); if (trace_file_tries) info_msg (_("found %s at %s\n"), soname, name); diff --git a/libiberty/ChangeLog b/libiberty/ChangeLog index dc1ef098304..4b599768bba 100644 --- a/libiberty/ChangeLog +++ b/libiberty/ChangeLog @@ -1,3 +1,7 @@ +2001-07-19 David O'Brien + + * lbasename.c: New file. + 2000-12-29 DJ Delorie * fnmatch.c: Make the note about the origins of this file more diff --git a/libiberty/Makefile.in b/libiberty/Makefile.in index 0eab5a6c141..16a040c7f89 100644 --- a/libiberty/Makefile.in +++ b/libiberty/Makefile.in @@ -128,7 +128,8 @@ CFILES = asprintf.c alloca.c argv.c atexit.c basename.c bcmp.c bcopy.c \ bzero.c calloc.c choose-temp.c clock.c concat.c cplus-dem.c \ cp-demangle.c dyn-string.c fdmatch.c fnmatch.c getcwd.c \ getpwd.c getopt.c getopt1.c getpagesize.c getruntime.c \ - floatformat.c hashtab.c hex.c index.c insque.c md5.c memchr.c \ + floatformat.c hashtab.c hex.c index.c insque.c lbasename.c \ + md5.c memchr.c \ memcmp.c memcpy.c memmove.c memset.c mkstemps.c objalloc.c obstack.c \ partition.c pexecute.c putenv.c random.c rename.c rindex.c setenv.c \ sigsetmask.c safe-ctype.c sort.c spaces.c splay-tree.c strcasecmp.c \ @@ -140,7 +141,8 @@ CFILES = asprintf.c alloca.c argv.c atexit.c basename.c bcmp.c bcopy.c \ # These are always included in the library. REQUIRED_OFILES = argv.o choose-temp.o concat.o cplus-dem.o cp-demangle.o \ dyn-string.o fdmatch.o fnmatch.o getopt.o getopt1.o getpwd.o \ - getruntime.o hashtab.o hex.o floatformat.o md5.o objalloc.o obstack.o \ + getruntime.o hashtab.o hex.o floatformat.o lbasename.o md5.o \ + objalloc.o obstack.o \ partition.o pexecute.o safe-ctype.o sort.o spaces.o splay-tree.o \ strerror.o strsignal.o xatexit.o xexit.o xmalloc.o xmemdup.o \ xstrdup.o xstrerror.o @@ -276,6 +278,7 @@ getpwd.o: config.h $(INCDIR)/libiberty.h getruntime.o: config.h $(INCDIR)/libiberty.h hex.o: $(INCDIR)/libiberty.h floatformat.o: $(INCDIR)/floatformat.h +lbasename.o: $(INCDIR)/libiberty.h mkstemps.o: config.h md5.o: config.h objalloc.o: config.h $(INCDIR)/objalloc.h