The test associated with the source file
gdb.base/share-env-with-gdbserver.c relies on calling malloc and free
within the inferior from GDB. However, as the test source itself
makes no use of these functions, there's no requirement that they be
linked into the test executable.
This commit adds a dummy call to malloc and free to ensure they are
linked into the test executable.
gdb/testsuite/ChangeLog:
* gdb.base/share-env-with-gdbserver.c (main): Add call to
malloc/free.
+2018-07-06 Andrew Burgess <andrew.burgess@embecosm.com>
+
+ * gdb.base/share-env-with-gdbserver.c (main): Add call to
+ malloc/free.
+
2018-07-04 Tom de Vries <tdevries@suse.de>
* gdb.dwarf2/dw2-error.exp: Update expected error message.
int
main (int argc, char *argv[])
{
+ /* Call malloc to ensure it is linked in. */
+ char *tmp = malloc (1);
const char *myvar = getenv ("GDB_TEST_VAR");
if (myvar != NULL)
else
printf ("It failed.");
+ free (tmp);
return 0; /* break-here */
}