freebsd-dev/lib/csu/mips
Ed Maste b0ec537031 mips: remove 16-byte alignment from .init and .fini epilogues
The .init and .fini epilogues from crtn should be placed immediately
after any instructions in .init and .fini sections from the linked
objects.  Using 16-byte alignment for the epilogues on MIPS was a bug,
but it did not cause any issue with GNU ld as GNU ld (2.17.50) fills the
padding with NOPs.

Current versions of LLD fill any padding between different object files
with trap instructions.  Inserting trap padding prior to the .init/.fini
epilogue is undesriable as the resulting binary will crash at runtime.

The .init and .fini sections in object files linked between crti and
crtn must already be a multiple of the instruction size and so no
alignment directive is required in crtn.  Indeed, other architectures
(except sparc64) do not specify alignment in their crtn implementations.

Reported by:	arichardson
Reviewed by:	andrew
Event:		Waterloo Hackathon 2019
Differential Revision:	https://reviews.freebsd.org/D18291
2019-05-20 20:48:04 +00:00
..
crt1.c lib: further adoption of SPDX licensing ID tags. 2017-11-26 02:00:33 +00:00
crt.h Mark the function called by the MIPS .init/.fini sequence with .local. 2018-11-23 16:33:03 +00:00
crti.S Don't include GNU object attributes when building with clang. 2017-08-30 19:19:31 +00:00
crtn.S mips: remove 16-byte alignment from .init and .fini epilogues 2019-05-20 20:48:04 +00:00
Makefile Process irelocs for statically linked binaries from crt1 on x86. 2018-10-13 23:52:55 +00:00
Makefile.depend META_MODE: Remove DEP_MACHINE from Makefile.depend files. 2015-09-25 19:44:01 +00:00