mirror of
https://github.com/netwide-assembler/nasm.git
synced 2024-11-27 08:10:07 +08:00
Elf-32: Implement segalign handling
Via elf_segalign helper Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
This commit is contained in:
parent
2a587ab1c9
commit
f68feb08c2
@ -1305,6 +1305,24 @@ static void elf_sect_write(struct Section *sect,
|
||||
sect->len += len;
|
||||
}
|
||||
|
||||
static void elf_segalign(int32_t seg, int value)
|
||||
{
|
||||
struct Section *s = NULL;
|
||||
int i;
|
||||
|
||||
for (i = 0; i < nsects; i++) {
|
||||
if (sects[i]->index == seg) {
|
||||
s = sects[i];
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!s || !is_power2(value))
|
||||
return;
|
||||
|
||||
if ((unsigned int)value > s->align)
|
||||
s->align = value;
|
||||
}
|
||||
|
||||
static int32_t elf_segbase(int32_t segment)
|
||||
{
|
||||
return segment;
|
||||
@ -1401,7 +1419,7 @@ struct ofmt of_elf32 = {
|
||||
elf_out,
|
||||
elf_deflabel,
|
||||
elf_section_names,
|
||||
null_segalign,
|
||||
elf_segalign,
|
||||
elf_segbase,
|
||||
elf_directive,
|
||||
elf_filename,
|
||||
|
Loading…
Reference in New Issue
Block a user