mirror of
https://github.com/netwide-assembler/nasm.git
synced 2025-01-18 16:25:05 +08:00
elf,stabs: stabs32/64_generate -- append ending token
This represent "end of compilation unit" token. Since gcc does (almost) the same lets be on the same side. Though to be precise gcc puts offset which points to the first byte right after the last instruction issued but in fact string index is analyzed only so we may safely write zero here (without relocation as well). Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
This commit is contained in:
parent
28032a027c
commit
69c4f63c25
@ -1689,19 +1689,16 @@ static void stabs32_generate(void)
|
||||
/*
|
||||
* worst case size of the stab buffer would be:
|
||||
* the sourcefiles changes each line, which would mean 1 SOL, 1 SYMLIN per line
|
||||
* plus one "ending" entry
|
||||
*/
|
||||
sbuf =
|
||||
(uint8_t *)nasm_malloc((numlinestabs * 2 + 3) *
|
||||
sizeof(struct stabentry));
|
||||
|
||||
sbuf = (uint8_t *)nasm_malloc((numlinestabs * 2 + 4) *
|
||||
sizeof(struct stabentry));
|
||||
ssbuf = (uint8_t *)nasm_malloc(strsize);
|
||||
|
||||
rbuf = (uint8_t *)nasm_malloc(numlinestabs * 8 * (2 + 3));
|
||||
rptr = rbuf;
|
||||
|
||||
for (i = 0; i < numfiles; i++) {
|
||||
for (i = 0; i < numfiles; i++)
|
||||
strcpy((char *)ssbuf + fileidx[i], allfiles[i]);
|
||||
}
|
||||
ssbuf[0] = 0;
|
||||
|
||||
stabstrlen = strsize; /* set global variable for length of stab strings */
|
||||
@ -1764,6 +1761,10 @@ static void stabs32_generate(void)
|
||||
|
||||
}
|
||||
|
||||
/* this is an "ending" token */
|
||||
WRITE_STAB(sptr, 0, N_SO, 0, 0, 0);
|
||||
numstabs++;
|
||||
|
||||
((struct stabentry *)sbuf)->n_desc = numstabs;
|
||||
|
||||
nasm_free(allfiles);
|
||||
|
@ -1763,21 +1763,19 @@ static void stabs64_generate(void)
|
||||
}
|
||||
}
|
||||
|
||||
/* worst case size of the stab buffer would be:
|
||||
the sourcefiles changes each line, which would mean 1 SOL, 1 SYMLIN per line
|
||||
/*
|
||||
* worst case size of the stab buffer would be:
|
||||
* the sourcefiles changes each line, which would mean 1 SOL, 1 SYMLIN per line
|
||||
* plus one "ending" entry
|
||||
*/
|
||||
sbuf =
|
||||
(uint8_t *)nasm_malloc((numlinestabs * 2 + 3) *
|
||||
sizeof(struct stabentry));
|
||||
|
||||
sbuf = (uint8_t *)nasm_malloc((numlinestabs * 2 + 4) *
|
||||
sizeof(struct stabentry));
|
||||
ssbuf = (uint8_t *)nasm_malloc(strsize);
|
||||
|
||||
rbuf = (uint8_t *)nasm_malloc(numlinestabs * 16 * (2 + 3));
|
||||
rptr = rbuf;
|
||||
|
||||
for (i = 0; i < numfiles; i++) {
|
||||
for (i = 0; i < numfiles; i++)
|
||||
strcpy((char *)ssbuf + fileidx[i], allfiles[i]);
|
||||
}
|
||||
ssbuf[0] = 0;
|
||||
|
||||
stabstrlen = strsize; /* set global variable for length of stab strings */
|
||||
@ -1841,6 +1839,10 @@ static void stabs64_generate(void)
|
||||
|
||||
}
|
||||
|
||||
/* this is an "ending" token */
|
||||
WRITE_STAB(sptr, 0, N_SO, 0, 0, 0);
|
||||
numstabs++;
|
||||
|
||||
((struct stabentry *)sbuf)->n_desc = numstabs;
|
||||
|
||||
nasm_free(allfiles);
|
||||
|
Loading…
Reference in New Issue
Block a user