Index: onbld/usr/src/tools/ctf/cvt/output.c =================================================================== --- onbld.orig/usr/src/tools/ctf/cvt/output.c +++ onbld/usr/src/tools/ctf/cvt/output.c @@ -477,8 +477,17 @@ write_file(Elf *src, const char *srcname * program headers. As such, we can just blindly copy the program * headers from the existing file to the new file. */ + /* + * libelfg0 by default checks for and forbids section overlapping, + * but ".SUNW_ldynsym" and ".dynsym" do overlap. + * It also defines ELF_F_LAYOUT_OVERLAP to allow ELF sections to overlap. + * In case we are not using libelfg0 we just set ELF_F_LAYOUT_OVERLAP to 0. + */ +#ifndef ELF_F_LAYOUT_OVERLAP +#define ELF_F_LAYOUT_OVERLAP 0 +#endif if (sehdr.e_phnum != 0) { - (void) elf_flagelf(dst, ELF_C_SET, ELF_F_LAYOUT); + (void) elf_flagelf(dst, ELF_C_SET, ELF_F_LAYOUT | ELF_F_LAYOUT_OVERLAP); if (gelf_newphdr(dst, sehdr.e_phnum) == 0) elfterminate(dstname, "Cannot make phdrs in temp file");