]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
mips: remove 16-byte alignment from .init and .fini epilogues
authoremaste <emaste@FreeBSD.org>
Mon, 20 May 2019 20:48:04 +0000 (20:48 +0000)
committeremaste <emaste@FreeBSD.org>
Mon, 20 May 2019 20:48:04 +0000 (20:48 +0000)
commita888be593dd20cfd96a740d4abc6d2fda7386447
treedff7ed50ba61fec9575eff505eab5d17397a173b
parent5c1190730c45959f68ebf4f22fdd6cee320ff5d7
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
lib/csu/mips/crtn.S