public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: "CHIGOT, CLEMENT" <clement.chigot@atos.net>
To: "gcc-patches@gcc.gnu.org" <gcc-patches@gcc.gnu.org>
Cc: David Edelsohn <dje.gcc@gmail.com>
Subject: [PATCH] aix: ensure reference to __tls_get_addr is in text section.
Date: Thu, 14 Oct 2021 07:06:36 +0000	[thread overview]
Message-ID: <PA4PR02MB6686AB43F30EF47E591F12E0EAB89@PA4PR02MB6686.eurprd02.prod.outlook.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 205 bytes --]

The garbage collector of AIX linker might remove the reference to
__tls_get_addr if it's added inside an unused csect.


Clément Chigot
ATOS Bull SAS
1 rue de Provence - 38432 Échirolles - France


[-- Attachment #2: 0001-aix-ensure-reference-to-__tls_get_addr-is-in-text-se.patch --]
[-- Type: application/octet-stream, Size: 934 bytes --]

From 17832ad26ffd061f5304acf03ca4f34646421e93 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Cl=C3=A9ment=20Chigot?= <clement.chigot@atos.net>
Date: Thu, 14 Oct 2021 09:03:13 +0200
Subject: [PATCH] aix: ensure reference to __tls_get_addr is in text section.

The garbage collector of AIX linker might remove the reference to
__tls_get_addr if it's added inside an unused csect.
---
 gcc/config/rs6000/rs6000.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c
index acba4d9f26c..62a98e7255c 100644
--- a/gcc/config/rs6000/rs6000.c
+++ b/gcc/config/rs6000/rs6000.c
@@ -21636,6 +21636,7 @@ rs6000_xcoff_file_end (void)
   if (xcoff_tls_exec_model_detected)
     {
       /* Add a .ref to __tls_get_addr to force libpthread dependency.  */
+      switch_to_section (text_section);
       fputs ("\t.extern __tls_get_addr\n\t.ref __tls_get_addr\n", asm_out_file);
     }
 }
-- 
2.33.0


             reply	other threads:[~2021-10-14  7:06 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-14  7:06 CHIGOT, CLEMENT [this message]
2021-10-14 13:42 ` David Edelsohn
2021-10-14 14:10   ` CHIGOT, CLEMENT
2021-10-14 14:37     ` David Edelsohn
2021-10-19 12:40 CHIGOT, CLEMENT

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=PA4PR02MB6686AB43F30EF47E591F12E0EAB89@PA4PR02MB6686.eurprd02.prod.outlook.com \
    --to=clement.chigot@atos.net \
    --cc=dje.gcc@gmail.com \
    --cc=gcc-patches@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: link
Be 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).