Hi,

This moves the definition of ELF_CTF into exec_elf.h and adjusts the
loadfile_elf.c copies accordingly.

OK?

Index: share/man/man5/elf.5
===================================================================
RCS file: /cvs/src/share/man/man5/elf.5,v
retrieving revision 1.32
diff -u -p -r1.32 elf.5
--- share/man/man5/elf.5        7 Sep 2016 18:42:01 -0000       1.32
+++ share/man/man5/elf.5        16 Sep 2016 19:16:37 -0000
@@ -877,6 +877,13 @@ fixed-size entries.
 .Pp
 Various sections hold program and control information:
 .Bl -tag -width ".shstrtab"
+.It .SUNW_ctf
+This section contains the (un)compressed Compact C-Type Format data
+describing the object's types and symbols.
+This section is of type
+.Dv SHT_NOBITS .
+The attribute used is
+.Dv SHF_ALLOC .
 .It .bss
 This section holds uninitialized data that contribute to the program's
 memory image.
Index: sys/ddb/db_ctf.c
===================================================================
RCS file: /cvs/src/sys/ddb/db_ctf.c,v
retrieving revision 1.1
diff -u -p -r1.1 db_ctf.c
--- sys/ddb/db_ctf.c    16 Sep 2016 19:13:17 -0000      1.1
+++ sys/ddb/db_ctf.c    16 Sep 2016 19:16:37 -0000
@@ -56,8 +56,6 @@ static char           *db_ctf_decompress(const ch
 static int              db_ctf_print_functions();
 static int              db_ctf_nsyms(void);
 
-#define        ELF_CTF ".SUNW_ctf"
-
 /*
  * Entrypoint to verify CTF presence, initialize the header, decompress
  * the data, etc.
Index: sys/lib/libsa/loadfile_elf.c
===================================================================
RCS file: /cvs/src/sys/lib/libsa/loadfile_elf.c,v
retrieving revision 1.12
diff -u -p -r1.12 loadfile_elf.c
--- sys/lib/libsa/loadfile_elf.c        13 Sep 2016 18:09:14 -0000      1.12
+++ sys/lib/libsa/loadfile_elf.c        16 Sep 2016 19:16:37 -0000
@@ -234,7 +234,7 @@ ELFNAME(exec)(int fd, Elf_Ehdr *elf, u_l
                        if (shp[i].sh_type == SHT_SYMTAB ||
                            shp[i].sh_type == SHT_STRTAB ||
                            !strcmp(shstr + shp[i].sh_name, ".debug_line") ||
-                           !strcmp(shstr + shp[i].sh_name, ".SUNW_ctf")) {
+                           !strcmp(shstr + shp[i].sh_name, ELF_CTF)) {
                                if (havesyms && (flags & LOAD_SYM)) {
                                        PROGRESS(("%s%ld", first ? " [" : "+",
                                            (u_long)shp[i].sh_size));
Index: sys/sys/exec_elf.h
===================================================================
RCS file: /cvs/src/sys/sys/exec_elf.h,v
retrieving revision 1.63
diff -u -p -r1.63 exec_elf.h
--- sys/sys/exec_elf.h  7 Sep 2016 20:12:42 -0000       1.63
+++ sys/sys/exec_elf.h  16 Sep 2016 19:16:36 -0000
@@ -264,6 +264,7 @@ typedef struct {
 /* Section names */
 #define ELF_BSS         ".bss"         /* uninitialized data */
 #define ELF_DATA        ".data"                /* initialized data */
+#define        ELF_CTF         ".SUNW_ctf"     /* CTF data */
 #define ELF_DEBUG       ".debug"       /* debug */
 #define ELF_DYNAMIC     ".dynamic"     /* dynamic linking information */
 #define ELF_DYNSTR      ".dynstr"      /* dynamic string table */
Index: usr.sbin/vmd/loadfile_elf.c
===================================================================
RCS file: /cvs/src/usr.sbin/vmd/loadfile_elf.c,v
retrieving revision 1.18
diff -u -p -r1.18 loadfile_elf.c
--- usr.sbin/vmd/loadfile_elf.c 13 Sep 2016 19:07:47 -0000      1.18
+++ usr.sbin/vmd/loadfile_elf.c 16 Sep 2016 19:16:37 -0000
@@ -779,7 +779,7 @@ elf64_exec(int fd, Elf64_Ehdr *elf, u_lo
                        if (shp[i].sh_type == SHT_SYMTAB ||
                            shp[i].sh_type == SHT_STRTAB ||
                            !strcmp(shstr + shp[i].sh_name, ".debug_line") ||
-                           !strcmp(shstr + shp[i].sh_name, ".SUNW_ctf")) {
+                           !strcmp(shstr + shp[i].sh_name, ELF_CTF)) {
                                if (havesyms && (flags & LOAD_SYM)) {
                                        if (lseek(fd, (off_t)shp[i].sh_offset,
                                            SEEK_SET) == -1) {

Cheers,
-- 
jasper

Reply via email to