summaryrefslogtreecommitdiffstats
path: root/usr.bin/ctfconv/elf.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Verify that every section header lies within the mapped file.mpi2017-11-141-16/+38
| | | | Pointed out by Mark Johnston, Markj@FreeBSD
* Use the symtab's sh_link to get the string table section.mpi2017-11-061-6/+22
| | | | | | | | | | This is technically more correct than looking for ".strtab" and allows us to get rid of unportable ELF_STRTAB. We can also get rid of the hack for some incorrect ELF files since we no longer try to apply relocations for the string table. From Mark Johnston, markj@FreeBSD
* Use <elf.h> rather than <sys/exec_elf.h>.mpi2017-10-271-2/+2
| | | | The former is more portable.
* Add some more boundary checks and prevent an attempt to divide by zerojsg2017-09-301-1/+17
| | | | | to resolve some additional crashes found by afl. ok mpi@ deraadt@
* Check that the end of sections do not exceed the filesize for bothjsg2017-09-291-10/+15
| | | | | | | symtab and sections. Corrects behaviour that led to crashes found via afl. ok mpi@
* Ignore file offset values in section headers that exceed the length ofjsg2017-09-261-2/+5
| | | | | | the file. Avoids a crash found with afl. ok mpi@
* quarterly rescan of the tree: remove unneccessary sys/param.h, andderaadt2017-08-291-2/+2
| | | | annotate the ones which are needed.
* add rcs idsjasper2017-08-111-0/+2
|
* Import a tool for generating CTF data section (SUNW_ctf) based on DWARFmpi2017-08-111-0/+284
information. ctfconv(1) support multiple CUs in order to work on binaries. ctfstrip(1) works like strip(1) but also insert a .SUNW_ctf section inside a binary. ok deraadt@, kettenis@, jasper@