out: Elf64, Elf32, Elfx32 -- Style merge

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
This commit is contained in:
Cyrill Gorcunov 2016-03-13 01:04:55 +03:00
parent 2bb791956e
commit 583f505155
3 changed files with 8 additions and 25 deletions

View file

@ -964,7 +964,7 @@ static void elf_write(void)
* Now output the section header table.
*/
elf_foffs = 0x40 + 0x28 * nsections;
elf_foffs = 0x40 + sizeof(Elf32_Shdr) * nsections;
align = ALIGN(elf_foffs, SEC_FILEALIGN) - elf_foffs;
elf_foffs += align;
elf_nsect = 0;
@ -1153,7 +1153,6 @@ static struct SAA *elf_build_symtab(int32_t *len, int32_t *local)
* dwarf needs symbols for debug sections
* which are relocation targets.
*/
/*** fix for 32 bit ***/
if (dfmt == &df_dwarf) {
dwarf_infosym = *local;
p = entry;
@ -1374,8 +1373,7 @@ const struct ofmt of_elf32 = {
elf_cleanup
};
/* again, the stabs debugging stuff (code) */
/* common debugging routines */
static void debug_typevalue(int32_t type)
{
int32_t stype, ssize;
@ -1445,11 +1443,9 @@ static void debug_typevalue(int32_t type)
/* stabs debugging routines */
static void stabs_linenum(const char *filename, int32_t linenumber,
int32_t segto)
static void stabs_linenum(const char *filename, int32_t linenumber, int32_t segto)
{
(void)segto;
if (!stabs_filename) {
stabs_filename = (char *)nasm_malloc(strlen(filename) + 1);
strcpy(stabs_filename, filename);
@ -1459,7 +1455,6 @@ static void stabs_linenum(const char *filename, int32_t linenumber,
in fact, this leak comes in quite handy to maintain a list of files
encountered so far in the symbol lines... */
/* why not nasm_free(stabs_filename); we're done with the old one */
stabs_filename = (char *)nasm_malloc(strlen(filename) + 1);
@ -1512,9 +1507,7 @@ static void stabs_generate(void)
ptr = stabslines;
allfiles = (char **)nasm_malloc(numlinestabs * sizeof(char *));
for (i = 0; i < numlinestabs; i++)
allfiles[i] = 0;
allfiles = (char **)nasm_zalloc(numlinestabs * sizeof(char *));
numfiles = 0;
while (ptr) {
if (numfiles == 0) {

View file

@ -986,9 +986,7 @@ static void elf_write(void)
add_sectname("", ".stab");
add_sectname("", ".stabstr");
add_sectname(".rel", ".stab");
}
else if (dfmt == &df_dwarf) {
} else if (dfmt == &df_dwarf) {
/* the dwarf debug standard specifies the following ten sections,
not all of which are currently implemented,
although all of them are defined. */
@ -1210,7 +1208,6 @@ static struct SAA *elf_build_symtab(int32_t *len, int32_t *local)
(*local)++;
}
/*
* Now the other local symbols.
*/
@ -1552,7 +1549,6 @@ static void stabs_linenum(const char *filename, int32_t linenumber, int32_t segt
currentline = linenumber;
}
static void stabs_output(int type, void *param)
{
struct symlininfo *s;
@ -1991,8 +1987,7 @@ static void dwarf_generate(void)
saa_write8(plines,0); /* End of table */
/* File Name Table */
ftentry = dwarf_flist;
for (indx = 0;indx<dwarf_numfiles;indx++)
{
for (indx = 0; indx < dwarf_numfiles; indx++) {
saa_wbytes(plines, ftentry->filename, (int32_t)(strlen(ftentry->filename) + 1));
saa_write8(plines,0); /* directory LEB128u */
saa_write8(plines,0); /* time LEB128u */

View file

@ -949,9 +949,7 @@ static void elf_write(void)
add_sectname("", ".stab");
add_sectname("", ".stabstr");
add_sectname(".rel", ".stab");
}
else if (dfmt == &df_dwarf) {
} else if (dfmt == &df_dwarf) {
/* the dwarf debug standard specifies the following ten sections,
not all of which are currently implemented,
although all of them are defined. */
@ -1172,7 +1170,6 @@ static struct SAA *elf_build_symtab(int32_t *len, int32_t *local)
(*local)++;
}
/*
* Now the other local symbols.
*/
@ -1512,7 +1509,6 @@ static void stabs_linenum(const char *filename, int32_t linenumber, int32_t segt
currentline = linenumber;
}
static void stabs_output(int type, void *param)
{
struct symlininfo *s;
@ -1948,8 +1944,7 @@ static void dwarf_generate(void)
saa_write8(plines,0); /* End of table */
/* File Name Table */
ftentry = dwarf_flist;
for (indx = 0;indx<dwarf_numfiles;indx++)
{
for (indx = 0; indx < dwarf_numfiles; indx++) {
saa_wbytes(plines, ftentry->filename, (int32_t)(strlen(ftentry->filename) + 1));
saa_write8(plines,0); /* directory LEB128u */
saa_write8(plines,0); /* time LEB128u */