public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
To: Stafford Horne <shorne@gmail.com>
Cc: GLIBC patches <libc-alpha@sourceware.org>,
	Openrisc <openrisc@lists.librecores.org>
Subject: Re: [PATCH v4 04/13] or1k: startup and dynamic linking code
Date: Tue, 4 Jan 2022 09:05:28 -0300	[thread overview]
Message-ID: <d3679ca1-8632-1b15-e54e-4c42fddae5dd@linaro.org> (raw)
In-Reply-To: <YdO6GmOcafGR1t9Z@antec>



On 04/01/2022 00:08, Stafford Horne wrote:
> On Tue, Jan 04, 2022 at 10:28:15AM +0900, Stafford Horne wrote:
>> On Mon, Jan 03, 2022 at 03:17:15PM -0300, Adhemerval Zanella wrote:
>>>
>>>
>>> On 29/12/2021 01:42, Stafford Horne via Libc-alpha wrote:
>>>> +/* Return nonzero iff ELF header is compatible with the running host.  */
>>>> +static inline int __attribute__ ((unused))
>>>> +elf_machine_matches_host (const Elf32_Ehdr *ehdr)
>>>> +{
>>>> +  return ehdr->e_machine == EM_OPENRISC;
>>>> +}
>>>> +
>>>> +static inline Elf32_Addr *
>>>> +or1k_get_got (void)
>>>> +{
>>>> +  Elf32_Addr *got;
>>>> +
>>>> +  asm ("l.jal    0x8\n"
>>>> +       " l.movhi %0, gotpchi(_GLOBAL_OFFSET_TABLE_-4)\n"
>>>> +       "l.ori    %0, %0, gotpclo(_GLOBAL_OFFSET_TABLE_+0)\n"
>>>> +       "l.add    %0, %0, r9\n"
>>>> +       : "=r" (got) : : "r9");
>>>
>>>
>>> I think this requires a "memory" clobber.
>>
>> Why would it?  This does not do any memory loads or stores.
>>
>> Let me test with "memory" clobber and see what the difference is.
> 
> If seem that with the "memory" clobber the compiler can no longer optimize away
> calling or1k_get_got the second time in elf_machine_load_address.
> 
> I will leave it out unless there is a good reason for it.

Fair enough, I had the impression it does access memory but it seems it
just my lack of or1k assembly knowledge. Sorry for the noise.

  reply	other threads:[~2022-01-04 12:05 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-29  4:42 [PATCH v4 00/13] Glibc OpenRISC port Stafford Horne
2021-12-29  4:42 ` [PATCH v4 01/13] elf: Add reloc for OpenRISC Stafford Horne
2021-12-29  4:42 ` [PATCH v4 02/13] linux/syscalls: Add or1k_atomic syscall " Stafford Horne
2021-12-29  4:42 ` [PATCH v4 03/13] or1k: ABI Implementation Stafford Horne
2021-12-29  4:46   ` Stafford Horne
2022-01-03 18:10   ` Adhemerval Zanella
2022-01-04  0:29     ` Stafford Horne
2021-12-29  4:42 ` [PATCH v4 04/13] or1k: startup and dynamic linking code Stafford Horne
2022-01-03 18:17   ` Adhemerval Zanella
2022-01-04  1:28     ` Stafford Horne
2022-01-04  3:08       ` Stafford Horne
2022-01-04 12:05         ` Adhemerval Zanella [this message]
2021-12-29  4:42 ` [PATCH v4 05/13] or1k: Thread Local Storage support Stafford Horne
2022-01-03 18:19   ` Adhemerval Zanella
2021-12-29  4:42 ` [PATCH v4 06/13] or1k: Atomics and Locking primitives Stafford Horne
2022-01-03 18:20   ` Adhemerval Zanella
2022-01-04  1:33     ` Stafford Horne
2021-12-29  4:42 ` [PATCH v4 07/13] or1k: math soft float support Stafford Horne
2022-01-03 18:21   ` Adhemerval Zanella
2021-12-29  4:42 ` [PATCH v4 08/13] or1k: Linux Syscall Interface Stafford Horne
2022-01-03 18:21   ` Adhemerval Zanella
2022-01-04  1:36     ` Stafford Horne
2021-12-29  4:42 ` [PATCH v4 09/13] or1k: Linux ABI Stafford Horne
2022-01-03 18:23   ` Adhemerval Zanella
2022-01-04  1:38     ` Stafford Horne
2021-12-29  4:42 ` [PATCH v4 10/13] or1k: ABI lists Stafford Horne
2021-12-31 17:45   ` Joseph Myers
2022-01-01  4:54     ` Stafford Horne
2022-01-02  0:30       ` Stafford Horne
2022-01-03 18:24   ` Adhemerval Zanella
2022-01-04  1:40     ` Stafford Horne
2021-12-29  4:42 ` [PATCH v4 11/13] or1k: Build Infrastructure Stafford Horne
2022-01-03 18:25   ` Adhemerval Zanella
2022-01-04  1:42     ` Stafford Horne
2021-12-29  4:42 ` [PATCH v4 12/13] build-many-glibcs.py: add OpenRISC support Stafford Horne
2022-01-03 18:26   ` Adhemerval Zanella
2022-01-04  1:43     ` Stafford Horne
2021-12-29  4:42 ` [PATCH v4 13/13] Documentation for OpenRISC port Stafford Horne
2022-01-03 18:31   ` Adhemerval Zanella
2022-01-03 18:35 ` [PATCH v4 00/13] Glibc " Adhemerval Zanella

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=d3679ca1-8632-1b15-e54e-4c42fddae5dd@linaro.org \
    --to=adhemerval.zanella@linaro.org \
    --cc=libc-alpha@sourceware.org \
    --cc=openrisc@lists.librecores.org \
    --cc=shorne@gmail.com \
    /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).