bug-binutils
[Top][All Lists]
Advanced

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

[Bug binutils/32271] strip leaves unused PT_LOAD segments


From: nickc at redhat dot com
Subject: [Bug binutils/32271] strip leaves unused PT_LOAD segments
Date: Thu, 17 Oct 2024 10:30:56 +0000

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

Nick Clifton <nickc at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |nickc at redhat dot com

--- Comment #2 from Nick Clifton <nickc at redhat dot com> ---
(In reply to Stas Sergeev from comment #1)

Hi Stas,

> Now we see that the segment 0, which
> was previously covering .note sections,
> is unmapped, but still has non-zero size.
> Segments 3, 4 and 5 are also not removed,
> but they are not PT_LOAD, and have zero
> size, so do not harm. But segment 0 should
> be removed IMO.

Agreed, although this is probably an enhancement rather than a bug.
Have you tried using eu-strip (from the elfutils project) or llvm-strip ?
They may produce the results that you expect.

> Also I wonder why the segment that contains
> .note sections is PT_LOAD? Is this really
> needed?

Because they are needed and used.  At least by ld.so on Linux boxes.
The notes contain information about the architecture extensions needed
by the application that is being loaded and the loader makes sure that
these are available before starting to run the code.

> I have my own elf loader, and it
> gets confused by this all.

It would probably be worth your while enhancing your loader so that it
can cope with these segments.  Even if it just ignores them.  It will
make things simpler in the long run.

Cheers
  Nick

-- 
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]