mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Rich Felker <dalias@libc.org>
To: erny hombre <hombre67@gmx.at>
Cc: musl@lists.openwall.com
Subject: Re: [musl] Data abort in __set_thread_area
Date: Thu, 4 Jun 2020 15:52:51 -0400	[thread overview]
Message-ID: <20200604195251.GS1079@brightrain.aerifal.cx> (raw)
In-Reply-To: <trinity-7c4ee463-1932-4f52-ae7a-73091ec42133-1591299397810@3c-app-gmx-bap65>

On Thu, Jun 04, 2020 at 09:36:37PM +0200, erny hombre wrote:
> Hello,
> 
> I am writing an operating system for an ARM processor (Cortex-A9).
> For the user programs I want to use musl libc. I have built a
> toolchain with musl-cross-make (musl 1.2.0). I can link a user
> program with libc.a. After loading the program, I call _start. Then
> I run into a data abort in function __set_thread_area
> (/musl-1.2.0/src/env/__libc_start_main.c) at this statement:
> 
> int ver = *(int *)0xffff0ffc;
> 
> The data abort is reasonable, because no memory is mapped at this
> virtual address. I don't know what's the purpose of this code. Can
> anybody explain me what this function does and which environment is
> needed to make it work ?

You need to either provide compatible kuser_helper functions mapped at
0xffff0000, or ensure HWCAP_TLS is set in the aux vector's AT_HWCAP to
indicate that the hardware thread pointer and atomics are available on
the particular cpu model.

Alternatively you can just ensure you build targeting armv7-a (to make
this the toolchain default configure it --with-arch=armv7-a) so that
this all gets hard-coded at compile time and there is no runtime
selection of atomics/tls access method.

Rich

      reply	other threads:[~2020-06-04 19:53 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-04 19:36 erny hombre
2020-06-04 19:52 ` Rich Felker [this message]

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=20200604195251.GS1079@brightrain.aerifal.cx \
    --to=dalias@libc.org \
    --cc=hombre67@gmx.at \
    --cc=musl@lists.openwall.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.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

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 NNTP newsgroup(s).