bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug binutils/26356] FAIL: objcopy --reverse-bytes


From: danglin at gcc dot gnu.org
Subject: [Bug binutils/26356] FAIL: objcopy --reverse-bytes
Date: Tue, 11 Aug 2020 11:58:38 +0000

https://sourceware.org/bugzilla/show_bug.cgi?id=26356

--- Comment #4 from John David Anglin <danglin at gcc dot gnu.org> ---
Hi Alan,

You are correct.  som_bfd_copy_private_section_data() is called once for the
subspace $DATA$.  This code is problematic:

  /* Reparent if necessary.  */
  if (som_section_data (osection)->copy_data->container)
    som_section_data (osection)->copy_data->container =
      som_section_data (osection)->copy_data->container->output_section;

After the memcpy, som_section_data (osection)->copy_data->container points to
the asection for $PRIVATE$.

som_section_data(osection)->copy_data->container->output_section is NULL.

Setting som_section_data (osection)->copy_data->container to NULL causes the
segmentation fault in som_is_space().  It is inlined in som_prep_headers().
osection no longer points to a valid space or subspace.  isection pointed
to a valid subspace.

If som_is_space() and som_is_subspace() are modified to return false when
the container is NULL, the output doesn't contain $PRIVATE$ and $DATA$, and
the test fails.

I'm thinking we need to copy both the containing space for $DATA$ and $DATA$.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]