* elf/dl-lookup.c (_dl_lookup_symbol): Avoid sizeof dynamic auto array

because that is broken on alpha.
This commit is contained in:
Roland McGrath 1996-07-17 03:34:06 +00:00
parent f36f8dcf1c
commit 184b7b466a
2 changed files with 6 additions and 3 deletions

View File

@ -1,5 +1,8 @@
Tue Jul 16 16:43:58 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
* elf/dl-lookup.c (_dl_lookup_symbol): Avoid sizeof dynamic auto array
because that is broken on alpha.
* sysdeps/mach/hurd/mmap.c: Use same inheritance arg in second vm_map
call as in first.

View File

@ -134,10 +134,10 @@ _dl_lookup_symbol (const char *undef_name, const ElfW(Sym) **ref,
{
/* We could find no value for a strong reference. */
const char msg[] = "undefined symbol: ";
char buf[sizeof msg + strlen (undef_name)];
const size_t len = strlen (undef_name);
char buf[sizeof msg + len];
memcpy (buf, msg, sizeof msg - 1);
memcpy (&buf[sizeof msg - 1], undef_name,
sizeof buf - sizeof msg + 1);
memcpy (&buf[sizeof msg - 1], undef_name, len + 1);
_dl_signal_error (0, reference_name, buf);
}