mirror of
https://github.com/netwide-assembler/nasm.git
synced 2025-02-17 17:19:35 +08:00
Avoid unnecessary warning on redefinition of section (bug 801180)
This commit is contained in:
parent
f23a5b042c
commit
2674b04d88
@ -333,7 +333,8 @@ static int elf_make_section(char *name, int type, int flags, int align)
|
||||
static int32_t elf_section_names(char *name, int pass, int *bits)
|
||||
{
|
||||
char *p;
|
||||
int flags_and, flags_or, type, align, i;
|
||||
unsigned flags_and, flags_or;
|
||||
int type, align, i;
|
||||
|
||||
/*
|
||||
* Default is 32 bits.
|
||||
@ -427,7 +428,9 @@ static int32_t elf_section_names(char *name, int pass, int *bits)
|
||||
sects[i]->flags &= ~flags_and;
|
||||
sects[i]->flags |= flags_or;
|
||||
} else if (pass == 1) {
|
||||
if (type || align || flags_and)
|
||||
if ((type && sects[i]->type != type)
|
||||
|| (align && sects[i]->align != align)
|
||||
|| (flags_and && ((sects[i]->flags & flags_and) != flags_or)))
|
||||
error(ERR_WARNING, "section attributes ignored on"
|
||||
" redeclaration of section `%s'", name);
|
||||
}
|
||||
|
@ -346,7 +346,8 @@ static int elf_make_section(char *name, int type, int flags, int align)
|
||||
static int32_t elf_section_names(char *name, int pass, int *bits)
|
||||
{
|
||||
char *p;
|
||||
int flags_and, flags_or, type, align, i;
|
||||
unsigned flags_and, flags_or;
|
||||
int type, align, i;
|
||||
|
||||
/*
|
||||
* Default is 64 bits.
|
||||
@ -440,8 +441,10 @@ static int32_t elf_section_names(char *name, int pass, int *bits)
|
||||
sects[i]->flags &= ~flags_and;
|
||||
sects[i]->flags |= flags_or;
|
||||
} else if (pass == 1) {
|
||||
if (type || align || flags_and)
|
||||
error(ERR_WARNING, "section attributes ignored on"
|
||||
if ((type && sects[i]->type != type)
|
||||
|| (align && sects[i]->align != align)
|
||||
|| (flags_and && ((sects[i]->flags & flags_and) != flags_or)))
|
||||
error(ERR_WARNING, "incompatible section attributes ignored on"
|
||||
" redeclaration of section `%s'", name);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user