public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Achim Gratz <Stromeko@nexgo.de>
To: binutils@sourceware.org
Subject: Re: [Bug] DWARF-5 section names in PE/PEP and weak symbols
Date: Tue, 15 Feb 2022 21:19:08 +0100	[thread overview]
Message-ID: <87y22bhohv.fsf@Rainer.invalid> (raw)
In-Reply-To: <87bkz8hv09.fsf@Rainer.invalid> (Achim Gratz's message of "Tue, 15 Feb 2022 18:58:30 +0100")

Achim Gratz writes:
> So, snprintf seems to behave as expected (it resolves NULL) and the two
> other symbols are resolved even though they should not.  If they had
> resolved to the actual address things might even work, but the actual
> values explain nicely why a program calling through the pointer crashes
> in various horrible ways (depending on what actually is mapped there).

I've verified that when I add potential call sites and not just printf
output to the other two functions, they no longer get resolved at link
time and show up as NULL in the resulting executable.  That part is
quite likely as intended.  However, if the linker doesn't see a call site
it resolves something that apparently doesn't work later on.  I have not
yet tracked down how the grep-3.7 binary ends up crashing, but the most
likely path is that theweak symbol gets resolved to something
nonsensical during an intermediate link step and then transferred into
the actual executable that doesn't resolve the symbol at all (using some
data in the object instead of the library) or not relocating correctly.


Regards,
Achim.
-- 
+<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+

SD adaptations for Waldorf Q V3.00R3 and Q+ V3.54R2:
http://Synth.Stromeko.net/Downloads.html#WaldorfSDada

      parent reply	other threads:[~2022-02-15 20:19 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-08 18:27 Achim Gratz
2021-12-15 13:12 ` Nick Clifton
2021-12-20 19:45   ` Achim Gratz
2022-01-23  8:10     ` Achim Gratz
2022-01-29  7:57   ` Achim Gratz
2022-02-13 20:17   ` Achim Gratz
2022-02-14 11:02     ` ASSI
2022-02-15 17:58       ` Achim Gratz
2022-02-15 19:08         ` Achim Gratz
2022-02-15 20:19         ` Achim Gratz [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=87y22bhohv.fsf@Rainer.invalid \
    --to=stromeko@nexgo.de \
    --cc=binutils@sourceware.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).