public inbox for gcc-cvs@sourceware.org help / color / mirror / Atom feed
From: Jakub Jelinek <jakub@gcc.gnu.org> To: gcc-cvs@gcc.gnu.org Subject: [gcc r12-6599] ada: Fix up handling of ghost units [PR104027] Date: Fri, 14 Jan 2022 23:02:17 +0000 (GMT) [thread overview] Message-ID: <20220114230217.E27233858C39@sourceware.org> (raw) https://gcc.gnu.org/g:952b7dbb418198f86d7829aaf9d7f9fc7714a8b3 commit r12-6599-g952b7dbb418198f86d7829aaf9d7f9fc7714a8b3 Author: Andrew Pinski <apinski@marvell.com> Date: Fri Jan 14 23:58:38 2022 +0100 ada: Fix up handling of ghost units [PR104027] As reported, libgnat-12.so gets PT_GNU_STACK RWE, which means it doesn't work in some SELinux configurations. This is caused by the a-nbnbig.o file, which is a ghost unit and since r12-5670 the FE emits an object file for it, but exits before compile_file has a chance to finalize it e.g. with targetm.asm_out.file_end () that emits the .note.GNU-stack section on various linux targets. Fixed by not existing but instead returning early to the caller. 2022-01-14 Andrew Pinski <apinski@marvell.com> PR ada/104027 * gnat1drv.adb (Gnat1drv): After Back_End.Gen_Or_Update_Object_File goto End_Of_Program. Diff: --- gcc/ada/gnat1drv.adb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/gcc/ada/gnat1drv.adb b/gcc/ada/gnat1drv.adb index 25c58238dca..f50feb2905d 100644 --- a/gcc/ada/gnat1drv.adb +++ b/gcc/ada/gnat1drv.adb @@ -1429,6 +1429,11 @@ begin Ecode := E_Success; Back_End.Gen_Or_Update_Object_File; + -- Use a goto instead of calling Exit_Program so that finalization + -- occurs normally. + + goto End_Of_Program; + -- Otherwise the unit is missing a crucial piece that prevents code -- generation.
reply other threads:[~2022-01-14 23:02 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20220114230217.E27233858C39@sourceware.org \ --to=jakub@gcc.gnu.org \ --cc=gcc-cvs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).