diff options
author | rpaulo <rpaulo@FreeBSD.org> | 2014-08-10 06:56:43 +0000 |
---|---|---|
committer | rpaulo <rpaulo@FreeBSD.org> | 2014-08-10 06:56:43 +0000 |
commit | 18059e8e63641d7d915ef4dddc33c240ec212729 (patch) | |
tree | 5300818d9f3b7b289d529b0f60747b58c05ad22a /cddl | |
parent | 336929ba0943beb4a3b5aa87a837d1fce57c07a9 (diff) | |
download | FreeBSD-src-18059e8e63641d7d915ef4dddc33c240ec212729.zip FreeBSD-src-18059e8e63641d7d915ef4dddc33c240ec212729.tar.gz |
Remove the BROKEN_LIBELF section.
This problem was fixed by Kai Wang in 2011.
MFC after: 3 days
Diffstat (limited to 'cddl')
-rw-r--r-- | cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c | 52 |
1 files changed, 0 insertions, 52 deletions
diff --git a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c index 2a43211..13300b0 100644 --- a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c +++ b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c @@ -1895,7 +1895,6 @@ dtrace_program_link(dtrace_hdl_t *dtp, dtrace_prog_t *pgp, uint_t dflags, goto done; } #if !defined(sun) -#define BROKEN_LIBELF /* * FreeBSD's ld(1) is not instructed to interpret and add * correctly the SUNW_dof section present in tfile. @@ -1919,9 +1918,6 @@ dtrace_program_link(dtrace_hdl_t *dtp, dtrace_prog_t *pgp, uint_t dflags, /* * Add the string '.SUWN_dof' to the shstrtab section. */ -#ifdef BROKEN_LIBELF - elf_flagelf(e, ELF_C_SET, ELF_F_LAYOUT); -#endif elf_getshdrstrndx(e, &stridx); scn = elf_getscn(e, stridx); gelf_getshdr(scn, &shdr); @@ -1933,54 +1929,6 @@ dtrace_program_link(dtrace_hdl_t *dtp, dtrace_prog_t *pgp, uint_t dflags, loc = shdr.sh_size; shdr.sh_size += data->d_size; gelf_update_shdr(scn, &shdr); -#ifdef BROKEN_LIBELF - off = shdr.sh_offset; - rc = shdr.sh_offset + shdr.sh_size; - gelf_getehdr(e, &ehdr); - if (ehdr.e_shoff > off) { - off = ehdr.e_shoff + ehdr.e_shnum * ehdr.e_shentsize; - rc = roundup(rc, 8); - ehdr.e_shoff = rc; - gelf_update_ehdr(e, &ehdr); - rc += ehdr.e_shnum * ehdr.e_shentsize; - } - for (;;) { - scn0 = NULL; - scn = NULL; - while ((scn = elf_nextscn(e, scn)) != NULL) { - gelf_getshdr(scn, &shdr); - if (shdr.sh_type == SHT_NOBITS || - shdr.sh_offset < off) - continue; - /* Find the immediately adjcent section. */ - if (scn0 == NULL || - shdr.sh_offset < shdr0.sh_offset) { - scn0 = scn; - gelf_getshdr(scn0, &shdr0); - } - } - if (scn0 == NULL) - break; - /* Load section data to work around another bug */ - elf_getdata(scn0, NULL); - /* Update section header, assure section alignment */ - off = shdr0.sh_offset + shdr0.sh_size; - rc = roundup(rc, shdr0.sh_addralign); - shdr0.sh_offset = rc; - gelf_update_shdr(scn0, &shdr0); - rc += shdr0.sh_size; - } - if (elf_update(e, ELF_C_WRITE) < 0) { - ret = dt_link_error(dtp, NULL, -1, NULL, - "failed to add append the shstrtab section: %s", - elf_errmsg(elf_errno())); - elf_end(e); - close(efd); - goto done; - } - elf_end(e); - e = elf_begin(efd, ELF_C_RDWR, NULL); -#endif /* * Construct the .SUNW_dof section. */ |