public inbox for binutils-cvs@sourceware.org
 help / color / mirror / Atom feed
* [binutils-gdb/binutils-2_43-branch] libctf: we do in fact support foreign-endian old versions
@ 2024-08-01 14:41 Nick Alcock
  0 siblings, 0 replies; only message in thread
From: Nick Alcock @ 2024-08-01 14:41 UTC (permalink / raw)
  To: binutils-cvs

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=cc7069a8c89a58eb97222fe78129a120ce8f01d2

commit cc7069a8c89a58eb97222fe78129a120ce8f01d2
Author: Nick Alcock <nick.alcock@oracle.com>
Date:   Fri Jul 5 15:53:14 2024 +0100

    libctf: we do in fact support foreign-endian old versions
    
    The worry that caused this to not be supported was because we don't
    bother endian-flipping version-related fields before checking them.
    But they're all unsigned chars anyway, and don't need any flipping at
    all.
    
    This should be supported and should already work.  Enable it.
    
    libctf/
            * ctf-open.c (ctf_bufopen): Don't prohibit foreign-endian
            upgrades.

Diff:
---
 libctf/ctf-open.c | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/libctf/ctf-open.c b/libctf/ctf-open.c
index 2ae0a696c3a..fd6d36edc46 100644
--- a/libctf/ctf-open.c
+++ b/libctf/ctf-open.c
@@ -1474,18 +1474,12 @@ ctf_bufopen (const ctf_sect_t *ctfsect, const ctf_sect_t *symsect,
 
      First, we validate the preamble (common to all versions).  At that point,
      we know the endianness and specific header version, and can validate the
-     version-specific parts including section offsets and alignments.
-
-     We specifically do not support foreign-endian old versions.  */
+     version-specific parts including section offsets and alignments.  */
 
   if (_libctf_unlikely_ (pp->ctp_magic != CTF_MAGIC))
     {
       if (pp->ctp_magic == bswap_16 (CTF_MAGIC))
-	{
-	  if (pp->ctp_version != CTF_VERSION_3)
-	    return (ctf_set_open_errno (errp, ECTF_CTFVERS));
-	  foreign_endian = 1;
-	}
+	foreign_endian = 1;
       else
 	return (ctf_set_open_errno (errp, ECTF_NOCTFBUF));
     }

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2024-08-01 14:41 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-08-01 14:41 [binutils-gdb/binutils-2_43-branch] libctf: we do in fact support foreign-endian old versions Nick Alcock

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).