Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Fri, 5 Mar 2021 17:30:37 -0800
From: Michael Forney <>
Cc: Rich Felker <>
Subject: Re: ld-musl-* and empty .eh_frame

On 2021-03-05, Fangrui Song <> wrote:
> Can you clarify how GNU ld creates an empty .eh_frame?

Sure, see the shell snippet in my original post.

> The program header PT_GNU_EH_FRAME is created from .eh_frame_hdr, which
> is created by ld --eh-frame-hdr.
> If .eh_frame is empty, from my observation GNU ld does not create
> .eh_frame_hdr

There is no PT_GNU_EH_FRAME in the executables. Based on Rich's
explanation earlier, my understanding is that the issue is that GNU ld
creates a empty PT_LOAD segment for the empty .eh_frame section.

I attached the output of readelf -l in case that is helpful.

>>I'm not too familiar with the binutils codebase, but I can try. As far
>>as I can tell, the alignment is set to at least the maximum page size:
> max-page-size is for layouting PT_LOAD.
> It is unrelated to PT_GNU_EH_FRAME.

The empty PT_LOAD segment is the issue here, not PT_GNU_EH_FRAME.

> The requirement is
> "p_vaddr should equal p_offset, modulo p_align."
> p_vaddr % p_align != 0 is valid.
> p_memsz can be zero.

Are you saying that GNU ld might create PT_LOAD segments with zero
size, and unaligned p_vaddr? If that's the case, I think Rich might
have a valid concern here.

View attachment "t-readelf.txt" of type "text/plain" (1891 bytes)

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.