[PATCH v2] mips: Fix store/load gp registers to/from ucontext_t
Gordana Cmiljanovic
Gordana.Cmiljanovic@imgtec.com
Wed Jun 7 19:24:00 GMT 2017
I tried to use debian scripts for building glibc 2.24-10: fakeroot debian/rules binary-arch
but they did not finish successfully (even without the patch).
Ended up with manually building for all three ABIs for LE and BE and here is the status:
mips o32 (LE + BE): test bug-getcontext-mips-gp failed without the patch and passed with the patch. There are no regressions introduced with the patch.
mips n32, mips n64 (LE + BE): stripped installed library with: strip --strip-unneeded libc-2.25.90.so
but the libraries are not identical. The difference is caused by two new symbols (MCONTEXT_GREGSZ and MCONTEXT_GREGOFF) in the GOT table, so the offsets for symbols below them are changed.
So, there are changes like this one throughout the code:
3c1e0: df83a858 ld v1,-22440(gp)
turns into:
3c1e0: df83a850 ld v1,-22448(gp)
Just to note: objdump of four modified functions is identical.
In case this is not sufficient, is there glibc build/test infrastructure that could run tests on mips n32/n64?
Also to mention that I run tst-sigcontext.c (from https://sourceware.org/bugzilla/attachment.cgi?id=4480) and it did not detect this issue.
Regards,
Gordana
________________________________________
From: Joseph Myers [joseph@codesourcery.com]
Sent: Thursday, May 18, 2017 7:51 PM
To: Gordana Cmiljanovic
Cc: libc-alpha@sourceware.org; Petar Jovanovic
Subject: RE: [PATCH] mips: Fix store/load gp registers to/from ucontext_t
On Thu, 18 May 2017, Gordana Cmiljanovic wrote:
> I have a simple test case which manifests getcontext() failure but since
> it is mips only test I was not sure where to add it. Do you have any
> suggestion?
It could be added to e.g. sysdeps/unix/sysv/linux/mips/ (or .../mips32/ if
o32-specific). Such a file would need to have a clearly MIPS-specific
name so it can't conflict with any architecture-independent test. The
appropriate sysdeps Makefile would need to add it to tests, conditional on
the value of $(subdir).
> I would say that mips N32 and mips64 are not affected by the change,
> since SZREG for them is 8 as per:
They shouldn't be affected - but to make sure there aren't any bugs in the
change that accidentally affect them, stripped installed shared libraries
before and after the change should be compared for all combinations of n32
or n64, BE or LE (the binaries should be identical).
--
Joseph S. Myers
joseph@codesourcery.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mips-Fix-store-load-gp-registers-to-from-ucontext_t-v2.patch
Type: text/x-patch
Size: 16161 bytes
Desc: mips-Fix-store-load-gp-registers-to-from-ucontext_t-v2.patch
URL: <http://sourceware.org/pipermail/libc-alpha/attachments/20170607/42d58b34/attachment.bin>
More information about the Libc-alpha
mailing list