public inbox for gdb-testers@sourceware.org
help / color / mirror / Atom feed
From: sergiodj+buildbot@sergiodj.net
To: gdb-testers@sourceware.org
Subject: [binutils-gdb] PR22394, hppa-linux-ld fails to emit dynamic relocations
Date: Sun, 05 Nov 2017 00:50:00 -0000	[thread overview]
Message-ID: <127e8e9f62ed0e7145dfa1172c6253275fc150dd@gdb-build> (raw)

*** TEST RESULTS FOR COMMIT 127e8e9f62ed0e7145dfa1172c6253275fc150dd ***

Author: Alan Modra <amodra@gmail.com>
Branch: master
Commit: 127e8e9f62ed0e7145dfa1172c6253275fc150dd

PR22394, hppa-linux-ld fails to emit dynamic relocations

gcc -mfast-indirect-calls emits a function pointer initialization
without a P% (plabel) modifier.  ld does not create the necessary
dynamic relocations for this to work.  It turns out that the problem
is caused by the non_got_ref symbol flag.  This flag is set for
non-pic by check_relocs to indicate that the symbol might need copy
relocations or dynamic relocations.  Later, the backend
adjust_dynamic_symbol clears the flag to indicate dynamic relocations
are needed, but leaves it set when copy relocations were created.  The
inversion in meaning is insane, but it's that way because the backend
adjust_dynamic_symbol function doesn't get to look at all symbols..
Anyway, the insanity works for non-function symbols.  However, the
flag is left set on any function symbol with a dynamic relocation.

This patch fixes the non_got_ref handling for function symbols, adds
-z nocopyreloc for hppa-elf, reports where textrel occurs, and expands
comments.  The check_relocs change just stops creation of dyn_relocs
we always threw away later.

	PR 22394
	* elf32-hppa.c (elf32_hppa_check_relocs): Don't create dyn_relocs
	for plabels when non-pic.
	(maybe_set_textrel): New function.
	(readonly_dynrelocs): Move and rewrite.
	(elf32_hppa_adjust_dynamic_symbol): Use it.  Don't create copy
	relocs when def_regular or -z nocopyreloc.  Handle non_got_ref
	for functions.  Expand non_got_ref comments.
	(elf32_hppa_size_dynamic_sections): Use maybe_set_textrel.


             reply	other threads:[~2017-11-05  0:50 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-05  0:50 sergiodj+buildbot [this message]
2017-11-05  0:50 ` Failures on Fedora-s390x-m64, branch master sergiodj+buildbot
2017-11-05  5:43 ` Failures on Fedora-x86_64-native-extended-gdbserver-m64, " sergiodj+buildbot
2017-11-05  5:49 ` Failures on Fedora-x86_64-m64, " sergiodj+buildbot
2017-11-05  5:49 ` Failures on Fedora-i686, " sergiodj+buildbot
2017-11-05  6:04 ` Failures on Fedora-x86_64-native-extended-gdbserver-m32, " sergiodj+buildbot
2017-11-05  6:14 ` Failures on Fedora-x86_64-cc-with-index, " sergiodj+buildbot
2017-11-05  6:19 ` Failures on Fedora-x86_64-m32, " sergiodj+buildbot
2017-11-05  6:23 ` Failures on Ubuntu-AArch64-native-gdbserver-m64, " sergiodj+buildbot
2017-11-05  6:55 ` Failures on Ubuntu-AArch64-m64, " sergiodj+buildbot
2017-11-05 11:33 ` Failures on Ubuntu-AArch32-native-extended-gdbserver-m32, " sergiodj+buildbot
2017-11-05 12:06 ` Failures on Ubuntu-AArch32-native-gdbserver-m32, " sergiodj+buildbot

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=127e8e9f62ed0e7145dfa1172c6253275fc150dd@gdb-build \
    --to=sergiodj+buildbot@sergiodj.net \
    --cc=gdb-testers@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).