mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Szabolcs Nagy <nsz@port70.net>
To: musl@lists.openwall.com
Cc: Paul Sykes <paulsykes@gmail.com>
Subject: Re: optopt in getopt not being set, only when building with OpenWrt
Date: Fri, 16 Nov 2018 22:11:00 +0100	[thread overview]
Message-ID: <20181116211100.GJ21289@port70.net> (raw)
In-Reply-To: <CALGVfyWtvkv0-4T7CCtz7q4nEHteURKL-VkoVtVDT0+sDU945w@mail.gmail.com>

* Paul Sykes <paulsykes@gmail.com> [2018-11-16 17:54:23 +0800]:
> On my OpenWrt builds I found that the optopt variable was never set
> when calling the function getopt. I tested the same code on my desktop
> using the gcc wrapper and optopt was set as expected.
> 
> Debugging showed that optopt was being set correctly in getopt.c
> however the variable was not being set in my calling code.
> 
> Adding optopt to the file 'dynamic.list' resolved the issue when
> building with OpenWrt. I noticed that all the other extern variables
> for getopt appear in dynamic.list except optopt.

yeah the dynamic list entry is needed so the address of the
object internally in the libc is the same as in the main
executable in case of copy relocation (only matters for
dynamic linked executables and pie executable may work
since that does not require copy relocs).

all targets with copy relocs are affected, but only musl
version 1.1.20 has the problem i think.


  reply	other threads:[~2018-11-16 21:11 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-16  9:54 Paul Sykes
2018-11-16 21:11 ` Szabolcs Nagy [this message]
2018-11-16 21:38   ` Rich Felker

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=20181116211100.GJ21289@port70.net \
    --to=nsz@port70.net \
    --cc=musl@lists.openwall.com \
    --cc=paulsykes@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.
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).