Re: [PATCH] Allow elf header to be used when __BEGIN_DECLS and __END_DECLS aren't defined.

2020-10-27 Thread Florian Weimer via Elfutils-devel
* Érico Nogueira via Libc-alpha: > This is mostly an initial PoC, and an additional comment for why this > is needed could be added to the file. > > I accidentally sent the wrong patch a while ago, sorry! extern "C++" does not have any effect for this header because it does not declare anything t

Re: [musl] Re: [QUESTION] Which fnmatch() functionality does elfutils depend on?

2020-10-27 Thread Florian Weimer via Elfutils-devel
* Rich Felker: > As I stated in my other reply, I'm opposed to that because it does not > admit implementation with the same (very desirable) big-O properties, > and the "extmatch" syntax is not widely known or widely used. The syntax comes from ksh and is used in shell scripts. (bash requires t

Re: Writing core files to contain buildids

2020-10-27 Thread Mark Wielaard
Hi Paul, On Mon, 2020-10-26 at 03:06 -0400, Paul Smith wrote: > We use this for various reasons rather than relying on the Linux > kernel > coredumper and it's worked well for us for many years now. However, I > would like to start using build IDs in our shared libs and binaries and > to take bes

Re: [PATCH v2] Stop depending on strndupa.

2020-10-27 Thread Mark Wielaard
Hi Érico, On Mon, 2020-10-26 at 15:33 -0300, Érico Nogueira via Elfutils-devel wrote: > From: Érico Rolim > > This functon has inherent safety issues, since a long enough path can > lead to memory clobbering. Instead, limit the path length to > PATH_MAX. I like getting rid of strndupa, because

Re: [musl] Re: [QUESTION] Which fnmatch() functionality does elfutils depend on?

2020-10-27 Thread Mark Wielaard
On Tue, 2020-10-27 at 10:19 +0100, Florian Weimer via Elfutils-devel wrote: > * Rich Felker: > > > As I stated in my other reply, I'm opposed to that because it does not > > admit implementation with the same (very desirable) big-O properties, > > and the "extmatch" syntax is not widely known or w

Re: [PATCH] Fix leb128 reading

2020-10-27 Thread Mark Wielaard
Hi Tom, On Mon, 2020-10-26 at 16:54 -0600, Tom Tromey wrote: > > > In this patch, I chose to try to handle weird leb128 encodings by > > > preserving their values when possible; or returning the maximum value > > > on overflow. It isn't clear to me that this is necessarily the best > > > choice.

Re: [musl] Re: [QUESTION] Which fnmatch() functionality does elfutils depend on?

2020-10-27 Thread Rich Felker
On Tue, Oct 27, 2020 at 04:04:44PM +0100, Mark Wielaard wrote: > On Tue, 2020-10-27 at 10:19 +0100, Florian Weimer via Elfutils-devel > wrote: > > * Rich Felker: > > > > > As I stated in my other reply, I'm opposed to that because it does not > > > admit implementation with the same (very desirabl

[PATCH v3] unstrip: Stop using strndupa.

2020-10-27 Thread Érico Nogueira via Elfutils-devel
From: Érico Rolim This functon has inherent safety issues, since a long enough path can lead to memory clobbering. Due to the recursive nature of make_directories(), multiple calls could also stack overflow. Instead, the string can be allocated in the heap. As a bonus, this improves musl compati

Re: [PATCH v2] Stop depending on strndupa.

2020-10-27 Thread Érico Nogueira via Elfutils-devel
On Tue Oct 27, 2020 at 1:01 PM -03, Mark Wielaard wrote: > Hi Érico, > > On Mon, 2020-10-26 at 15:33 -0300, Érico Nogueira via Elfutils-devel > wrote: > > From: Érico Rolim > > > > This functon has inherent safety issues, since a long enough path can > > lead to memory clobbering. Instead, limit

Re: Writing core files to contain buildids

2020-10-27 Thread Paul Smith
Thanks Mark, On Tue, 2020-10-27 at 15:39 +0100, Mark Wielaard wrote: > The basic idea behind getting buildids into core files is that they > (the GNU ELF notes) are at the start of the file in the first page > that is dumped (together with the phdrs) in the core file so when > core file consumers

Re: [PATCH v3] unstrip: Stop using strndupa.

2020-10-27 Thread Mark Wielaard
Hi Érico, On Tue, Oct 27, 2020 at 04:19:58PM -0300, Érico Nogueira via Elfutils-devel wrote: > This functon has inherent safety issues, since a long enough path can > lead to memory clobbering. Due to the recursive nature of > make_directories(), multiple calls could also stack overflow. Instead,

Re: [musl] Re: [QUESTION] Which fnmatch() functionality does elfutils depend on?

2020-10-27 Thread Mark Wielaard
Hi Rich, On Tue, Oct 27, 2020 at 01:08:17PM -0400, Rich Felker wrote: > On Tue, Oct 27, 2020 at 04:04:44PM +0100, Mark Wielaard wrote: > > Right, it is also adopted by zsh and some other shells. The big-O > > properties don't really matter in this case because fnmatch is used on > > small input st

Re: Writing core files to contain buildids

2020-10-27 Thread Mark Wielaard
Hi Paul, On Tue, Oct 27, 2020 at 04:20:51PM -0400, Paul Smith wrote: > On Tue, 2020-10-27 at 15:39 +0100, Mark Wielaard wrote: > > The basic idea behind getting buildids into core files is that they > > (the GNU ELF notes) are at the start of the file in the first page > > that is dumped (together

Re: [musl] Re: [QUESTION] Which fnmatch() functionality does elfutils depend on?

2020-10-27 Thread Rich Felker
On Tue, Oct 27, 2020 at 11:19:11PM +0100, Mark Wielaard wrote: > Hi Rich, > > On Tue, Oct 27, 2020 at 01:08:17PM -0400, Rich Felker wrote: > > On Tue, Oct 27, 2020 at 04:04:44PM +0100, Mark Wielaard wrote: > > > Right, it is also adopted by zsh and some other shells. The big-O > > > properties don

Re: Writing core files to contain buildids

2020-10-27 Thread Paul Smith
On Tue, 2020-10-27 at 23:23 +0100, Mark Wielaard wrote: > Do you have the generated core files somehwere so others can look at > them? How exactly are you testing the build-id notes are there? I don't have one to publish but I can create one. That's a good idea anyway as it will be simpler to deb