Fix a problem with scanning wide chars.

We found that the testcase

int
main (void)
{
  wchar_t s[10];
  memset (s, 0, sizeof (s));
  int r = sscanf ("s", "%ls", s);
  printf ("%d\n", r);
  printf ("%ls\n", s);
  return 0;
}

printed
0
<blankline>

rather than the expected
1
s

The problem was the enum in _scanf.c, which has had a 'CONV_m' value
inserted. The attached patch fixes the problem in __psfs_parse_spec by
not presuming a particular displacement between the two sets of
char-like conversion values. With this patch the above program produces
the expected output.

Signed-off-by: Nathan Sidwell <nathan@codesourcery.com>
Signed-off-by: Bernd Schmidt <bernds@codesourcery.com>
Fix some fragileness in dlopen/do_dlopen wrapper & worker pair.

do_dlopen contains __builtin_return_address to determine from
whence it was called, and uses that to determine which dynamic
object's data it should use to start the search.  (In the bug I was
tracking, this related to whether the application's RPATH was used or
not.)  For that to work, it has to have been inlined into the wrapper
function.

As it happens, it wasn't being inlined.  That's an unfortunate compiler
behaviour, but it isn't wrong and shouldn't have caused dlopen to fail.

This patch changes things so the wrapper function determines the
return address, and passes it to the worker.  If the worker's inlined,
the generated code should be exactly the same as before.

Signed-off-by: Nathan Sidwell <nathan@codesourcery.com>
Signed-off-by: Bernd Schmidt <bernds@codesourcery.com>
libc: Fix common-generic stat.h for BE

Signed-off-by: Mischa Jonker <mjonker@synopsys.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>