public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Alan Modra <amodra@gmail.com>
To: binutils@sourceware.org
Cc: "Maciej W . Rozycki" <macro@orcam.me.uk>,
	Chenghua Xu <paul.hua.gm@gmail.com>,
	Alan Modra <amodra@gmail.com>
Subject: mips hi16/lo16 reloc handling
Date: Tue, 19 Dec 2023 20:05:44 +1030	[thread overview]
Message-ID: <20231219093546.2112095-1-amodra@gmail.com> (raw)

In May this year I posted a patch to move the list of hi16 relocs from
per-file data to per-section data, where it makes more sense and is
not vunerable to fuzzed object file attacks.
https://sourceware.org/pipermail/binutils/2023-May/127534.html and
https://sourceware.org/pipermail/binutils/2023-May/127535.html
These incorporated the results of an earlier discussion in February.

A lot was going on in May with mips, so I'm not at all surprised that
no one reviewed the patch.  Or perhaps a review only went so far as
finding a segfault in gas..  That is fixed in this version.  We do
need to keep struct mips_hi16 "data" field to cope with gas frags.  A
lo16 reloc might apply to a different frag than the corresponding hi16
reloc.  Also, some other infrastructure changes meant that the posted
patches no longer apply cleanly.

The patches have been tested by running the binutils testsuite, and
building and regression testing a current gcc cross from x86_64-linux
to mips-linux (no sim installed).

Alan Modra (2):
  Move mips_hi16_list to mips_elf_section_data
  coff-mips refhi list

 bfd/coff-alpha.c |   6 +-
 bfd/coff-mips.c  | 121 +++++++++++-----------------
 bfd/ecoff.c      |  34 ++++++--
 bfd/elfxx-mips.c | 206 ++++++++++++++++++++++++-----------------------
 bfd/libecoff.h   |  30 +++----
 5 files changed, 201 insertions(+), 196 deletions(-)


             reply	other threads:[~2023-12-19  9:36 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-19  9:35 Alan Modra [this message]
2023-12-19  9:35 ` Move mips_hi16_list to mips_elf_section_data Alan Modra
2023-12-19  9:35 ` coff-mips refhi list Alan Modra

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=20231219093546.2112095-1-amodra@gmail.com \
    --to=amodra@gmail.com \
    --cc=binutils@sourceware.org \
    --cc=macro@orcam.me.uk \
    --cc=paul.hua.gm@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.
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).