summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCharles Crayne <chuck@thor.crayne.org>2007-10-17 17:55:45 -0700
committerCharles Crayne <chuck@thor.crayne.org>2007-10-17 17:55:45 -0700
commitf23a5b042c9d0d762a9e9bc72df44b6a74affc02 (patch)
treef6db7974bbc59c5670fa422b055cd77a8039131c
parente911708790d0b2a09aa16615bcd21affabaf4379 (diff)
downloadnasm-f23a5b042c9d0d762a9e9bc72df44b6a74affc02.tar.gz
nasm-f23a5b042c9d0d762a9e9bc72df44b6a74affc02.tar.bz2
nasm-f23a5b042c9d0d762a9e9bc72df44b6a74affc02.zip
Generate stabs entries for any executable section
-rw-r--r--output/outelf32.c14
-rw-r--r--output/outelf64.c14
2 files changed, 14 insertions, 14 deletions
diff --git a/output/outelf32.c b/output/outelf32.c
index 6466b1e..e021ba7 100644
--- a/output/outelf32.c
+++ b/output/outelf32.c
@@ -1394,7 +1394,7 @@ void stabs32_output(int type, void *param)
if (type == TY_STABSSYMLIN) {
if (stabs_immcall) {
s = (struct symlininfo *)param;
- if (strcmp(s->name, ".text"))
+ if (!(sects[s->section]->flags & SHF_EXECINSTR))
return; /* we are only interested in the text stuff */
numlinestabs++;
el = (struct linelist *)nasm_malloc(sizeof(struct linelist));
@@ -1492,16 +1492,16 @@ void stabs32_generate(void)
stabstrlen = strsize; /* set global variable for length of stab strings */
sptr = sbuf;
- /* this is the first stab, its strx points to the filename of the
- the source-file, the n_desc field should be set to the number
- of remaining stabs
- */
- WRITE_STAB(sptr, fileidx[0], 0, 0, 0, strlen(allfiles[0] + 12));
-
ptr = stabslines;
numstabs = 0;
if (ptr) {
+ /* this is the first stab, its strx points to the filename of the
+ the source-file, the n_desc field should be set to the number
+ of remaining stabs
+ */
+ WRITE_STAB(sptr, fileidx[0], 0, 0, 0, strlen(allfiles[0] + 12));
+
/* this is the stab for the main source file */
WRITE_STAB(sptr, fileidx[mainfileindex], N_SO, 0, 0, 0);
diff --git a/output/outelf64.c b/output/outelf64.c
index a72a6bf..3ef19a2 100644
--- a/output/outelf64.c
+++ b/output/outelf64.c
@@ -1409,7 +1409,7 @@ void stabs64_output(int type, void *param)
if (type == TY_STABSSYMLIN) {
if (stabs_immcall) {
s = (struct symlininfo *)param;
- if (strcmp(s->name, ".text"))
+ if (!(sects[s->section]->flags & SHF_EXECINSTR))
return; /* we are only interested in the text stuff */
numlinestabs++;
el = (struct linelist *)nasm_malloc(sizeof(struct linelist));
@@ -1507,16 +1507,16 @@ void stabs64_generate(void)
stabstrlen = strsize; /* set global variable for length of stab strings */
sptr = sbuf;
- /* this is the first stab, its strx points to the filename of the
- the source-file, the n_desc field should be set to the number
- of remaining stabs
- */
- WRITE_STAB(sptr, fileidx[0], 0, 0, 0, strlen(allfiles[0] + 12));
-
ptr = stabslines;
numstabs = 0;
if (ptr) {
+ /* this is the first stab, its strx points to the filename of the
+ the source-file, the n_desc field should be set to the number
+ of remaining stabs
+ */
+ WRITE_STAB(sptr, fileidx[0], 0, 0, 0, strlen(allfiles[0] + 12));
+
/* this is the stab for the main source file */
WRITE_STAB(sptr, fileidx[mainfileindex], N_SO, 0, 0, 0);