mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Rich Felker <dalias@libc.org>
To: "Robert Skopalík" <rs@income.cz>
Cc: "musl@lists.openwall.com" <musl@lists.openwall.com>,
	"Miroslav Němeček" <mn@income.cz>
Subject: Re: [musl] strtok
Date: Fri, 19 Jun 2020 21:44:47 -0400	[thread overview]
Message-ID: <20200620014447.GQ6430@brightrain.aerifal.cx> (raw)
In-Reply-To: <VI1PR10MB3566D5FE83DD57C24EDF0BD1CF990@VI1PR10MB3566.EURPRD10.PROD.OUTLOOK.COM>

On Sat, Jun 20, 2020 at 12:46:43AM +0000, Robert Skopalík wrote:
> I wouldn't like to bother you more than neccessary, but if you don't
> mind (as I hope :), I have one more question:
> 
> Do we really need got table for a noMMU MCU? Fdpic uses it and I was
> looking for the answer what is it for pretty long - no success.
> Wouldn't it be enough just to keep the data segment offset in r9 and
> make all the data relative to it (in compiler)? That would get rid
> of the whole got table complexities. Bad idea? :)

That doesn't admit shared libraries, just multiple instances of the
same static-linked binary. It's not a supported ABI so you'd need to
hack up a toolchain and modified musl to do it.

On the other hand if you don't care about sharing text at all (might
be the case if yout text is expected to be very small anyway) you can
just use normal PIE binaries.

Rich


> -----Original Message-----
> From: Rich Felker [mailto:dalias@libc.org] 
> Sent: Saturday, June 20, 2020 2:16 AM
> To: Robert Skopalík
> Cc: musl@lists.openwall.com; Miroslav Němeček
> Subject: Re: [musl] strtok
> 
> On Sat, Jun 20, 2020 at 12:03:12AM +0000, Robert Skopalík wrote:
> > Hello,
> > 
> > we are working on an OS for a STM32 MCU. We like how the reentrancy
> > is solved in musl, but ... when two (or more) userspace programs
> > using a strtok function are run, there might be a collision (because
> > strtok uses a static var to save the pointer). We did not find any
> > redirection mechanism from strtok to strtok_r. How is it meant pls?
> > We do not want to force the users to write strtok_r into a
> > non-threaded user program.
> > 
> > Is there some solution to make it work right?
> > 
> > Thank you
> 
> If multiple programs are running, each needs its own execution context
> including its own versions of all libc (and any other) global data.
> Probably you should look into the ARM FDPIC ABI, which is the right
> way to do this while still sharing program text for MMU-less
> microcontrollers like the one you're working with. The tooling should
> be mature now so that support could be added to musl, but making it
> happen needs people who are interested in providing feedback and
> testing.
> 
> Rich

  reply	other threads:[~2020-06-20  1:45 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-15 13:19 [musl] Hexagon DSP support sidneym
2020-04-15 16:30 ` Rich Felker
2020-04-15 17:50   ` sidneym
2020-04-15 18:06     ` Szabolcs Nagy
2020-04-15 18:22       ` sidneym
2020-04-16  9:36         ` Szabolcs Nagy
2020-04-16 15:34           ` Rich Felker
2020-04-16 16:26             ` sidneym
2020-04-16 16:34               ` 'Rich Felker'
2020-04-15 18:26       ` Rich Felker
2020-04-15 19:12         ` sidneym
2020-04-15 19:29           ` 'Rich Felker'
2020-04-30 22:44             ` sidneym
2020-04-30 23:51               ` Rich Felker
2020-05-05 23:37                 ` sidneym
2020-05-06  0:59                   ` Rich Felker
2020-06-18 16:37                     ` sidneym
2020-06-18 21:42                       ` Szabolcs Nagy
2020-06-19 21:58                         ` sidneym
2020-06-19 22:46                           ` Rich Felker
2020-06-20  0:03                             ` [musl] strtok Robert Skopalík
2020-06-20  0:15                               ` Rich Felker
2020-06-20  0:36                                 ` Robert Skopalík
2020-06-20  0:46                                 ` Robert Skopalík
2020-06-20  1:44                                   ` Rich Felker [this message]
2020-06-20  7:07                                 ` Patrick Oppenlander
2020-06-20 13:00                                   ` Robert Skopalík
2020-06-22  0:57                                     ` Bery Saidi
2020-06-20  2:29                             ` [musl] Hexagon DSP support sidneym
2020-06-20  3:20                               ` Rich Felker
2020-07-20 21:26                                 ` sidneym
2020-07-23 21:56                                   ` Szabolcs Nagy
2020-07-24 17:49                                     ` sidneym
2020-09-16 20:49                                     ` sidneym
2020-09-17  1:32                                       ` 'Rich Felker'
2020-09-17 22:31                                         ` sidneym
2020-09-18  1:08                                           ` Rich Felker
2020-09-18  8:10                                             ` Szabolcs Nagy
2020-09-20 13:12                                             ` sidneym
2020-09-20 17:17                                               ` 'Rich Felker'
2020-09-21 14:09                                                 ` sidneym
2020-04-15 18:55 ` Fangrui Song

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=20200620014447.GQ6430@brightrain.aerifal.cx \
    --to=dalias@libc.org \
    --cc=mn@income.cz \
    --cc=musl@lists.openwall.com \
    --cc=rs@income.cz \
    /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).