History log of /external/elfutils/libelf/elf32_updatenull.c
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
272018bba1f253bae00b5ba280ad0e0f18c04006 19-Dec-2015 Mark Wielaard <mjw@redhat.com> libelf: Add elf_compress and elf_compress_gnu.

Signed-off-by: Mark Wielaard <mjw@redhat.com>
/external/elfutils/libelf/elf32_updatenull.c
3adda3ce2a83e2733aa0c84da9bb7949413d02fd 29-Sep-2015 Mark Wielaard <mjw@redhat.com> libelf: Always update e_version and e_shentsize in elf_update.

When e_version is EV_NONE we should set it to EV_CURRENT like we do for
the EI_VERSION and like we set EI_DATA to the correct byte order when set
to ELFDATANONE. Likewise we should always set e_shentsize like we do for
e_phentsize, not just when ELF_F_LAYOUT isn't set.

Add a new elfshphehdr testcase to check the above.

Signed-off-by: Mark Wielaard <mjw@redhat.com>
/external/elfutils/libelf/elf32_updatenull.c
c2297eab17b7dbb98021b51f063f71d1cdc7893a 13-May-2015 Mark Wielaard <mjw@redhat.com> libelf: If e_phnum is zero then set e_phoff also to zero.

If phnum is zero make sure e_phoff is also zero and not some random value.
That would cause trouble in update_file. This could happen when ELF_F_LAYOUT
is set and the user copied over a ehdr from a bogus ELF file where the phdrs
are unreadable. In that case trying to write out the new ELF image would
crash trying to follow the bogus e_phdr value.

Signed-off-by: Mark Wielaard <mjw@redhat.com>
/external/elfutils/libelf/elf32_updatenull.c
c0748eff8473b0caa6d51812aa31349bf1dce042 12-May-2015 Mark Wielaard <mjw@redhat.com> libelf: More checking of valid sh_addralign values.

There were two issues with bogus sh_addralign values. First we would only
check the individual Elf_Data d_align values were powerof2. But not the
actual shdr addralign value. This would cause an issue if the shdr addralign
was bigger than all of the individual d_align values. Then we could write
out a bogus (! powerof2) shdr addralign value for the sections. Secondly
when reading in the Elf_Data we would set the d_align value to the value
of the shdr addralign value. But we would not check it was valid at all.
In practice there are ELF files with incorrect sh_addralign values (they
are a powerof2, but aren't aligned to the ELF image offset). We would try
to fix that up in elf_update by adding extra padding. But this could bloat
the ELF image a lot for large alignment values. So for too large alignments
that are bigger than the offset in the ELF file clamp them to the offset
value. This could lead us to reject to write out the data again when the
offset was not a powerof2. But this will only happen for aligment values
bigger than 64. Which are uncommon in practice.

Signed-off-by: Mark Wielaard <mjw@redhat.com>
/external/elfutils/libelf/elf32_updatenull.c
5370bb0a6492cb4669c8375e53748a4303997ed7 23-Mar-2015 Mark Wielaard <mjw@redhat.com> libelf: Don't extend ELF file size with SHT_NOBITS sh_offset.

Don't explicitly extend the file size for SHT_NOBITS sections. Since
that could cause a size beyond any actual file content it will cause
issues when the underlying ELF file has been mmapped or will extend
the file size to increase (writing fill bytes) when not mmapped. The
sh_offset value is essentially meaningless for SHT_NOBITS. gabi says
that a NOBITS section sh_offset member locates the "conceptual
placement" in the file. But it doesn't say this cannot be beyond the
enf of the file. When ELF_F_LAYOUT is set we should trust sh_offset
as given is what is wanted for an SHT_NOBITS section without extending
the file size.

https://bugzilla.redhat.com/show_bug.cgi?id=1020842

Buggy binutils ld could generate files where SHT_NOBITS sections have
sh_offset outside the file.
https://sourceware.org/bugzilla/show_bug.cgi?id=12921

Signed-off-by: Mark Wielaard <mjw@redhat.com>
/external/elfutils/libelf/elf32_updatenull.c
6f5934c1afa8f34bfb8f86b191ded9af854e757f 07-Feb-2015 Jan Kratochvil <jan.kratochvil@redhat.com> libelf: Consider sh_addralign 0 as 1

Currently the Koji build for arm32 fails with:
extracting debug info from /builddir/build/BUILDROOT/etcd-2.0.0-0.3.rc1.fc22.arm/usr/bin/etcd
Failed to write file: invalid section alignment

This is because the binary etcd
http://people.redhat.com/jkratoch/etcdctl.xz
contains:
Section Headers:
[Nr] Name Type Addr Off Size ES Flg Lk Inf Al
[11] .rel.plt REL 00459ee0 449ee0 000088 08 A 13 0 0
^
which corresponds to golang's code:
go/src/cmd/ld/elf.c
case EM_X86_64:
sh = elfshname(".rela.plt");
sh->addralign = RegSize;
default:
sh = elfshname(".rel.plt");
<nothing>

ELF spec says:
Values 0 and 1 mean the section has no alignment constraints.
and libelf/elf32_updatenull.c really parses it that way at line 204
ElfW2(LIBELFBITS,Word) sh_align = shdr->sh_addralign ?: 1;
but unfortunately the later line being patched no longer does.

libelf/
2015-02-07 Jan Kratochvil <jan.kratochvil@redhat.com>

* elf32_updatenull.c (__elfw2(LIBELFBITS,updatenull_wrlock)): Consider
sh_addralign 0 as 1.

Signed-off-by: Jan Kratochvil <jan.kratochvil@redhat.com>
/external/elfutils/libelf/elf32_updatenull.c
de2ed97f33139af5c7a0811e4ec66fc896a13cf2 05-Jun-2012 Mark Wielaard <mjw@redhat.com> Update name, license and contributor policy.

* Change name from "Red Hat elfutils" to "elfutils".
* Update license of standalone tools and test from GPLv2 to GPLv3+.
* Change license of libraries from GPLv2+exception to GPLv2/LGPLv3+.
* Add Developer Certificate of Origin based contributor policy.

top-level:

- COPYING: Upgraded from GPLv2 to GPLv3.
- CONTRIBUTING, COPYING-GPLv2, COPYING-LGPLv3: New files.
- NEWS: Added note about new contribution and license policy.
- Makefile.am: Updated to GPLv3, added new files to EXTRA_DIST.
- configure.ac: Update to GPLv3, changed AC_INIT name to 'elfutils'.

backends, lib, libasm, libcpu, libdw, libdwfl, libebl, libelf:

- All files updated to GPLv2/LGPLv3+. Except some very small files
(<5 lines) which didn't have any headers at all before, the linker
.maps files and the libcpu/defs files which only contain data and
libelf/elf.h which comes from glibc and is under LGPLv2+.

config:

- elfutils.spec.in: Add new License: headers and new %doc files.
- Update all license headers to GPLv2/LGPLv3+ for files used by libs.

src, tests:

- All files updated to GPLv3+. Except for the test bz2 data files, the
linker maps and script files and some very small files (<5 lines)
that don't have any headers.

Signed-off-by: Richard Fontana <rfontana@redhat.com>
Signed-off-by: Mark Wielaard <mjw@redhat.com>
/external/elfutils/libelf/elf32_updatenull.c
6fd3cd104adf4107aa64e1c1e84028b4ea0b3296 08-Jan-2010 Roland McGrath <roland@redhat.com> Add elf_getphdrnum, support >65536 phdrs.
/external/elfutils/libelf/elf32_updatenull.c
119f4acbaec5b538a4206fd261067137d3588f55 26-Jan-2009 Ulrich Drepper <drepper@redhat.com> Fix commit in updatenull_wrlock wrt to layout resulting from section header
table position and size.
/external/elfutils/libelf/elf32_updatenull.c
02f66452635df3d01f7e57845c3362ab828e3d89 04-Dec-2008 Ulrich Drepper <drepper@redhat.com> propagate from branch 'com.redhat.elfutils.roland.pending.libelf-threads' (head fc97c9c202b5d7d7699a3b1d5c53007a2ef37bb1)
to branch 'com.redhat.elfutils' (head 67cccb9bfffc1a7fe3d8d355a2d9b6d0e489ff81)
/external/elfutils/libelf/elf32_updatenull.c
b4d6f0f8064f2b706ea9035ef0393d8299671390 26-Aug-2008 Roland McGrath <roland@redhat.com> Fix up bogon and missing log entries from .pmachata.threads branch.
/external/elfutils/libelf/elf32_updatenull.c
d56e232fb8f8cd97a336ed612c89145ec121f785 16-Aug-2008 Ulrich Drepper <drepper@redhat.com> propagate from branch 'com.redhat.elfutils.pmachata.threads' (head 8bd3bc10eb015c96f7bafcc6a22c973620b57dd8)
to branch 'com.redhat.elfutils' (head c5a11b6b3329382f1b5ffd0020f0d93c64176f20)
/external/elfutils/libelf/elf32_updatenull.c
56bc0b83ea81b7e959aaa4e1d01f8b36f2804a52 18-Dec-2006 Ulrich Drepper <drepper@redhat.com> Lock down libelf and elflint a bit more after import of Roland's changes.
/external/elfutils/libelf/elf32_updatenull.c
8190db6a86a37aec86c81626ab1b083c96aff891 18-Dec-2006 Roland McGrath <roland@redhat.com> propagate from branch 'com.redhat.elfutils' (head b4944cf70801d9dac056f4f80ef1334e5acb8bdc)
to branch 'com.redhat.elfutils.roland.pending' (head e7e402c668fb0670fc5f6b6a522853ae88f32f11)
/external/elfutils/libelf/elf32_updatenull.c
077c65f3be02e5d01b0c4dea3f6c854077d156fc 12-Jul-2006 Ulrich Drepper <drepper@redhat.com> merge of 67f3844b544f03a64b3ac896c19f94744923d76a
and ba017f6b59b4ad649cf32f4eefdfecca8b31332c
/external/elfutils/libelf/elf32_updatenull.c
cc41562f94052f307da4429f33cc18c7d510b2f5 12-Jul-2006 Ulrich Drepper <drepper@redhat.com> propagate from branch 'com.redhat.elfutils.roland.pending' (head e5cfdd13aa39dfae16b905fd57ff56ad8a131bb5)
to branch 'com.redhat.elfutils' (head 60222fc1981540f15e674b6705fd7a6f628f95a4)
/external/elfutils/libelf/elf32_updatenull.c
7f7f1bc0e20aa95f780b55272c19d514ee3dd1c7 12-Jul-2006 Ulrich Drepper <drepper@redhat.com> Adjust for internal_function_def removal.
/external/elfutils/libelf/elf32_updatenull.c
1e9ef50681e20ef14c2ba38aef37a71ff148be08 05-Apr-2006 Ulrich Drepper <drepper@redhat.com> Fix FSF address. No exception for libdwarf.
/external/elfutils/libelf/elf32_updatenull.c
361df7da6dfecd817b27e62b91752ac316d7cdd4 04-Apr-2006 Ulrich Drepper <drepper@redhat.com> propagate from branch 'com.redhat.elfutils.roland.pending' (head 4f8fc821345feef58624f0aa5b470d4827577d8c)
to branch 'com.redhat.elfutils' (head 76e26cb54695fd3b21ee8fb5be3036bd68200633)
/external/elfutils/libelf/elf32_updatenull.c
697d8d283e5fda32c1930135ff884dd276499e4a 04-Apr-2006 Ulrich Drepper <drepper@redhat.com> Fix read/write of existing file using mmap and different layout of the ELF
file.
/external/elfutils/libelf/elf32_updatenull.c
b08d5a8fb42f4586d756068065186b5af7e48dad 26-Jul-2005 Ulrich Drepper <drepper@redhat.com> Adjust for monotone.
/external/elfutils/libelf/elf32_updatenull.c