<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/elfutils.git/libdwelf/libdwelf.h, branch master</title>
<subtitle>sourceware.org: git/elfutils.git
</subtitle>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/elfutils.git/'/>
<entry>
<title>libdwelf: fix spelling typos in comments</title>
<updated>2020-12-12T17:06:28+00:00</updated>
<author>
<name>Dmitry V. Levin</name>
<email>ldv@altlinux.org</email>
</author>
<published>2020-12-12T16:51:15+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/elfutils.git/commit/?id=b8d1683ce4f77a6e537a68f1e4ce63fe2210ce2e'/>
<id>b8d1683ce4f77a6e537a68f1e4ce63fe2210ce2e</id>
<content type='text'>
algorith -&gt; algorithm
occured -&gt; occurred

Signed-off-by: Dmitry V. Levin &lt;ldv@altlinux.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
algorith -&gt; algorithm
occured -&gt; occurred

Signed-off-by: Dmitry V. Levin &lt;ldv@altlinux.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>libdwelf: Make dwelf_elf_begin return NULL only when there is an error.</title>
<updated>2019-08-13T10:16:18+00:00</updated>
<author>
<name>Mark Wielaard</name>
<email>mark@klomp.org</email>
</author>
<published>2019-08-11T22:43:22+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/elfutils.git/commit/?id=7ea82243ec3e556518116c51b528c3a4eb6d16f3'/>
<id>7ea82243ec3e556518116c51b528c3a4eb6d16f3</id>
<content type='text'>
dwelf_elf_begin was slightly different from elf_begin in case the file
turned out to not be an ELF file. elf_begin would return an Elf handle
with ELF_K_NONE. But dwelf_elf_begin would return NULL. This made it
impossible to tell the difference between a file or decompression error
and a (decompressed) file not being an ELF file.

Since dwelf_elf_begin could still return different kinds of ELF files
(ELF_K_ELF or ELF_K_AR - and theoretically ELF_K_COFF) this was not
really useful anyway. So make it so that dwelf_elf_begin always returns
an Elf handle unless there was a real error reading or decompressing
the file. Otherwise return NULL to make clear there was a real error.

Make sure that the decompression function returns DWFL_E_BADELF only
when the file isn't compressed. In which case the Elf handle won't
be replaced and can be returned (as ELF_K_NONE).

Add a new version to dwelf_elf_begin so programs can rely on it
returning NULL only for real errors.

Signed-off-by: Mark Wielaard &lt;mark@klomp.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
dwelf_elf_begin was slightly different from elf_begin in case the file
turned out to not be an ELF file. elf_begin would return an Elf handle
with ELF_K_NONE. But dwelf_elf_begin would return NULL. This made it
impossible to tell the difference between a file or decompression error
and a (decompressed) file not being an ELF file.

Since dwelf_elf_begin could still return different kinds of ELF files
(ELF_K_ELF or ELF_K_AR - and theoretically ELF_K_COFF) this was not
really useful anyway. So make it so that dwelf_elf_begin always returns
an Elf handle unless there was a real error reading or decompressing
the file. Otherwise return NULL to make clear there was a real error.

Make sure that the decompression function returns DWFL_E_BADELF only
when the file isn't compressed. In which case the Elf handle won't
be replaced and can be returned (as ELF_K_NONE).

Add a new version to dwelf_elf_begin so programs can rely on it
returning NULL only for real errors.

Signed-off-by: Mark Wielaard &lt;mark@klomp.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>libdwelf: Add dwelf_elf_e_machine_string and use it in readelf.</title>
<updated>2019-07-10T12:08:33+00:00</updated>
<author>
<name>Mark Wielaard</name>
<email>mark@klomp.org</email>
</author>
<published>2019-06-28T17:21:59+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/elfutils.git/commit/?id=b3233914074cb7eb19ea2fc3c70257679f867f68'/>
<id>b3233914074cb7eb19ea2fc3c70257679f867f68</id>
<content type='text'>
To print eh human readable description of the ELF e_machine header field
we used the ebl name. But this is not set for most EM constants. Introduce
a new function dwelf_elf_e_machine_string that does work for all known
EM values. Use that in eu-readelf to print a string representation of the
e_machine value.

Since this was the only usage of ebl-&gt;name, remove that from struct ebl.

Also add a testcase that makes sure dwelf_elf_e_machine_string works for
all EM values in the libelf/elf.h header so we will immediately notice
when a new value appears.

Signed-off-by: Mark Wielaard &lt;mark@klomp.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
To print eh human readable description of the ELF e_machine header field
we used the ebl name. But this is not set for most EM constants. Introduce
a new function dwelf_elf_e_machine_string that does work for all known
EM values. Use that in eu-readelf to print a string representation of the
e_machine value.

Since this was the only usage of ebl-&gt;name, remove that from struct ebl.

Also add a testcase that makes sure dwelf_elf_e_machine_string works for
all EM values in the libelf/elf.h header so we will immediately notice
when a new value appears.

Signed-off-by: Mark Wielaard &lt;mark@klomp.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>libdwelf: New function dwelf_elf_begin.</title>
<updated>2018-11-09T17:11:48+00:00</updated>
<author>
<name>Mark Wielaard</name>
<email>mark@klomp.org</email>
</author>
<published>2018-10-21T21:41:32+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/elfutils.git/commit/?id=ecbe3120cddb1b9597a19a68c4265e4f2c530444'/>
<id>ecbe3120cddb1b9597a19a68c4265e4f2c530444</id>
<content type='text'>
This introduces a new function dwelf_elf_begin which creates a (read-only)
ELF handle from a possibly compressed file handle or a file that start
with a linux kernel header. This can be used in eu-readelf to (re)open a
(pure) ELF.

eu-readelf uses libdwfl to relocate addresses in the original file in
case it is ET_REL. But to show the "raw" data it might need to (re)open
the file. Which could fail if the file was compressed. And produced an
obscure error message: "cannot create EBL handle".

This rewrites __libdw_open_file a little so that the given file handle
will never be closed (whether on success or failure) and introduces a
new internal function __libdw_open_elf that dwelf_elf_begin wraps.

Signed-off-by: Mark Wielaard &lt;mark@klomp.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This introduces a new function dwelf_elf_begin which creates a (read-only)
ELF handle from a possibly compressed file handle or a file that start
with a linux kernel header. This can be used in eu-readelf to (re)open a
(pure) ELF.

eu-readelf uses libdwfl to relocate addresses in the original file in
case it is ET_REL. But to show the "raw" data it might need to (re)open
the file. Which could fail if the file was compressed. And produced an
obscure error message: "cannot create EBL handle".

This rewrites __libdw_open_file a little so that the given file handle
will never be closed (whether on success or failure) and introduces a
new internal function __libdw_open_elf that dwelf_elf_begin wraps.

Signed-off-by: Mark Wielaard &lt;mark@klomp.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>dwelf: Add string table functions from ebl.</title>
<updated>2016-08-03T16:19:47+00:00</updated>
<author>
<name>Mark Wielaard</name>
<email>mjw@redhat.com</email>
</author>
<published>2016-07-08T12:08:22+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/elfutils.git/commit/?id=dd906c1b4852be4dd34924017261f89cc5c4c723'/>
<id>dd906c1b4852be4dd34924017261f89cc5c4c723</id>
<content type='text'>
Move the strtab functions from libebl to libdw. Programs often want to
create ELF/DWARF string tables. We don't want (static) linking against
ebl since those are internal functions that might change.

This introduces dwelf_strtab_init, dwelf_strtab_add,
dwelf_strtab_add_len, dwelf_strtab_finalize, dwelf_strent_off,
dwelf_strent_str and dwelf_strtab_free. Documentation for each has
been added to libdwelf.h. The add fucntion got a variant that takes
the length explicitly and finalize was changed to return NULL on
out of memory instead of aborting. All code and tests now uses the
new functions.

Signed-off-by: Mark Wielaard &lt;mjw@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Move the strtab functions from libebl to libdw. Programs often want to
create ELF/DWARF string tables. We don't want (static) linking against
ebl since those are internal functions that might change.

This introduces dwelf_strtab_init, dwelf_strtab_add,
dwelf_strtab_add_len, dwelf_strtab_finalize, dwelf_strent_off,
dwelf_strent_str and dwelf_strtab_free. Documentation for each has
been added to libdwelf.h. The add fucntion got a variant that takes
the length explicitly and finalize was changed to return NULL on
out of memory instead of aborting. All code and tests now uses the
new functions.

Signed-off-by: Mark Wielaard &lt;mjw@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>libdwelf: Add dwelf_scn_gnu_compressed_size.</title>
<updated>2016-01-06T13:27:10+00:00</updated>
<author>
<name>Mark Wielaard</name>
<email>mjw@redhat.com</email>
</author>
<published>2015-11-17T22:52:39+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/elfutils.git/commit/?id=0c32b6f086b9838fe4b7d93575068554d0c420f7'/>
<id>0c32b6f086b9838fe4b7d93575068554d0c420f7</id>
<content type='text'>
Helper function to get the size of a GNU compressed zdebug section.

Signed-off-by: Mark Wielaard &lt;mjw@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Helper function to get the size of a GNU compressed zdebug section.

Signed-off-by: Mark Wielaard &lt;mjw@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>libdwelf: Add dwelf_elf_gnu_build_id.</title>
<updated>2014-05-01T11:51:31+00:00</updated>
<author>
<name>Mark Wielaard</name>
<email>mjw@redhat.com</email>
</author>
<published>2014-04-30T21:00:40+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/elfutils.git/commit/?id=d81d32d2a4f92355e4c677b578147dfe819251b9'/>
<id>d81d32d2a4f92355e4c677b578147dfe819251b9</id>
<content type='text'>
Move internal function __libdwfl_find_build_id to libdwelf and use it to
add a public dwelf_elf_gnu_build_id function to extract the NT_GNU_BUILD_ID
from an ELF file using either the shdrs or phdrs. Adjust internal callers
and add a testcase.

Signed-off-by: Mark Wielaard &lt;mjw@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Move internal function __libdwfl_find_build_id to libdwelf and use it to
add a public dwelf_elf_gnu_build_id function to extract the NT_GNU_BUILD_ID
from an ELF file using either the shdrs or phdrs. Adjust internal callers
and add a testcase.

Signed-off-by: Mark Wielaard &lt;mjw@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>libdwelf: Add dwelf_dwarf_gnu_debugaltlink</title>
<updated>2014-04-24T12:40:59+00:00</updated>
<author>
<name>Florian Weimer</name>
<email>fweimer@redhat.com</email>
</author>
<published>2014-04-24T12:06:43+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/elfutils.git/commit/?id=4813dbbcb81a0f5ebbc9756fe6f4ed62d298b011'/>
<id>4813dbbcb81a0f5ebbc9756fe6f4ed62d298b011</id>
<content type='text'>
Signed-off-by: Florian Weimer &lt;fweimer@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: Florian Weimer &lt;fweimer@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>libdwelf: New DWARF ELF Low-level Functions. Add dwelf_elf_gnu_debuglink.</title>
<updated>2014-04-24T11:18:33+00:00</updated>
<author>
<name>Mark Wielaard</name>
<email>mjw@redhat.com</email>
</author>
<published>2014-04-11T21:52:47+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/elfutils.git/commit/?id=9380297e130e6ccc829c8d56d701fb539b27bb0f'/>
<id>9380297e130e6ccc829c8d56d701fb539b27bb0f</id>
<content type='text'>
New public header elfutils/libdwelf.h for low-level DWARF/ELF helper
functions.  The new function dwelf_elf_gnu_debuglink returns the name and
crc as found in the .gnu_debuglink section of an ELF file.

Signed-off-by: Mark Wielaard &lt;mjw@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
New public header elfutils/libdwelf.h for low-level DWARF/ELF helper
functions.  The new function dwelf_elf_gnu_debuglink returns the name and
crc as found in the .gnu_debuglink section of an ELF file.

Signed-off-by: Mark Wielaard &lt;mjw@redhat.com&gt;
</pre>
</div>
</content>
</entry>
</feed>
