Commit Graph

15 Commits

Author SHA1 Message Date
Kyle Evans
4b3b82a756 mips: fix some mcount nits
The symbol version for _mcount was removed 12 years ago in r169525 from
gmon/Symbol.map, to be added to the per-arch Symbol.map. mips was overlooked
in this, so _mcount has no symver. Add it back to where it should have been,
rather than where it would go if it were added today, since we're correcting
a historical mistake.

Additionally, _mcount is getting thrown into .mdebug.abi32 in the llvm80/90
world as it's not getting explicitly thrown into .text, so do this now. This
fixes the libc build that was previously failing due to relocations in
.mdebug.abi32. This is specifically due to the way clang's integrated AS
works and that they emit the .mdebug.abiNN section early in the process. An
LLVM bug has been submitted[0] and an agreement has been made that the
mips backend should switch to .text following .mdebug.abiNN for
compatibility.

[0] https://bugs.llvm.org/show_bug.cgi?id=43119

Reviewed by:	imp, arichardson
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D21435
2019-09-02 01:55:55 +00:00
Brooks Davis
db19a093bb Remove MD __sys_* private symbols.
No references to any of these exist in the tree. The list was also
erratic with different architectures exporting different things
(arm64 and riscv exported none).

Reviewed by:	kib
Sponsored by:	DARPA, AFRL
Differential Revision:	https://reviews.freebsd.org/D18425
2018-12-05 00:46:09 +00:00
Mark Johnston
9f9c9b22ec Reimplement brk() and sbrk() to avoid the use of _end.
Previously, libc.so would initialize its notion of the break address
using _end, a special symbol emitted by the static linker following
the bss section.  Compatibility issues between lld and ld.bfd could
cause the wrong definition of _end (libc.so's definition rather than
that of the executable) to be used, breaking the brk()/sbrk()
interface.

Avoid this problem and future interoperability issues by simply not
relying on _end.  Instead, modify the break() system call to return
the kernel's view of the current break address, and have libc
initialize its state using an extra syscall upon the first use of the
interface.  As a side effect, this appears to fix brk()/sbrk() usage
in executables run with rtld direct exec, since the kernel and libc.so
no longer maintain separate views of the process' break address.

PR:		228574
Reviewed by:	kib (previous version)
MFC after:	2 months
Differential Revision:	https://reviews.freebsd.org/D15663
2018-06-04 19:35:15 +00:00
John Baldwin
fbb7370d33 Move softfloat symbol map entries to softfloat/Symbol.map.
The arm, mips, and riscv MD Symbol.map files listed some (but not all)
of the softfloat symbols that were actually defined in softfloat.c.

While here, also remove entries for __fixuns[sd]fsi which are provided
by libcompiler_rt and not by libc.

Sponsored by:	DARPA / AFRL
2018-03-05 20:51:23 +00:00
John Baldwin
04a91333db Include {u,}{div,mod}si3() on mips in libcompiler_rt.
These builtins were listed in the mips-specific Symbol.map for libc but
were not implemented.  Compiling mips with recent clang requires these
symbols.

Sponsored by:	DARPA / AFRL
2017-08-21 17:49:01 +00:00
Ruslan Bukin
5bca221511 Add full softfloat and hardfloat support for MIPS.
This adds new target architectures for hardfloat:
mipselhf mipshf mips64elhf mips64hf.

Tested in QEMU only.

Sponsored by:	DARPA, AFRL
Sponsored by:	HEIF5
Differential Revision:	https://reviews.freebsd.org/D8376
2016-10-31 15:33:58 +00:00
Ed Maste
a38e4f5cc6 libc: stop exporting cerror
i386 stopped exporting .cerror in r240152, and likewise for amd64 in
r240178. It is not used by other libraries on any platform, so apply
the same change to the remaining architectures.

Reviewed by:	jhibbits, jilles
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D5774
2016-03-30 14:42:09 +00:00
Ed Maste
dae2d550d6 libc: stop exporting curbrk and minbrk in the private namespace
They are not used anywhere else in the base system and are an internal
implementation detail that does not need to be exposed.

Reviewed by:	kib
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D5728
2016-03-24 18:47:19 +00:00
David Schultz
6232589aeb Replace a proliferation of buggy MD implementations of modf() with a
working MI one.  The MI one only needs to be overridden on machines
with non-IEEE754 arithmetic.  (The last supported one was the VAX.)
It can also be overridden if someone comes up with a faster one that
actually passes the regression tests -- but this is harder than it sounds.
2011-10-21 06:40:36 +00:00
Ed Schouten
3a28b8a49f Fix whitespace inconsistencies found in homegrown Symbol.maps. 2011-10-07 15:05:24 +00:00
Jayachandran C.
9279d32a64 Merge jmallett@'s n64 work into HEAD - changeset 2
Update libc Makefiles.
Add makecontext implementation.

Changes from http://svn.freebsd.org/base/user/jmallett/octeon

Approved by:	rrs(mentor), jmallett
2010-06-16 14:13:36 +00:00
Warner Losh
52e0ea7a0d Merge r195030 from project/mips to head by hand
r195030 | gonzo | 2009-06-25 19:27:31 -0600 (Thu, 25 Jun 2009) | 4 lines
- Switch to libc softfloat from libgcc implementation. The problem
    with latter is that it is not complete, fpsetXXX/fpgetXXX
    functions are missing.
2010-01-09 00:01:35 +00:00
Warner Losh
87e925fb53 Merge r197800 from projects/mips to head by hand:
r197800 | gonzo | 2009-10-06 00:35:52 -0600 (Tue, 06 Oct 2009) | 3 lines
- curbrk variable for sbrk and brk should be the same
- Add correct variable names to Symbol.map
2010-01-08 23:59:04 +00:00
Warner Losh
51cbd5d9d7 These symbols don't belong here. Remove them. Since mips hasn't had
a release, I think there's no impact here...

Reviewed by:	cognet@
2009-02-19 18:03:41 +00:00
Warner Losh
4ce261061f Add mips support libc from the mips2-jnpr branch of perforce. 2008-04-26 12:08:02 +00:00