EXTRA_DIST += modules/objfmts/dbg/Makefile.inc
EXTRA_DIST += modules/objfmts/bin/Makefile.inc
EXTRA_DIST += modules/objfmts/elf/Makefile.inc
+#!EXTRA_DIST += modules/objfmts/omf/Makefile.inc
EXTRA_DIST += modules/objfmts/coff/Makefile.inc
EXTRA_DIST += modules/objfmts/win32/Makefile.inc
include modules/objfmts/dbg/Makefile.inc
include modules/objfmts/bin/Makefile.inc
include modules/objfmts/elf/Makefile.inc
+#!include modules/objfmts/omf/Makefile.inc
include modules/objfmts/coff/Makefile.inc
include modules/objfmts/win32/Makefile.inc
if (!yasm_symrec_get_label(sym, &precbc))
return 1;
sect = yasm_bc_get_section(precbc);
- is_sect = strcmp(yasm_symrec_get_name(sym),
- yasm_section_get_name(sect))==0;
+ if (!yasm_section_is_absolute(sect) &&
+ strcmp(yasm_symrec_get_name(sym), yasm_section_get_name(sect))==0)
+ is_sect = 1;
/* neither sections nor locals (except when debugging) need names */
entry = elf_symtab_insert_local_sym(info->objfmt_elf->elf_symtab,
YASM_WRITE_8(bufp, ELF32_ST_INFO(entry->bind, entry->type));
YASM_WRITE_8(bufp, 0);
if (entry->sect) {
- elf_secthead *shead =
- yasm_section_get_data(entry->sect, &elf_section_data);
- if (!shead)
- yasm_internal_error(
- N_("symbol references section without data"));
- YASM_WRITE_16_L(bufp, shead->index);
+ if (yasm_section_is_absolute(entry->sect)) {
+ YASM_WRITE_16_L(bufp, SHN_ABS);
+ } else {
+ elf_secthead *shead = yasm_section_get_data(entry->sect,
+ &elf_section_data);
+ if (!shead)
+ yasm_internal_error(
+ N_("symbol references section without data"));
+ YASM_WRITE_16_L(bufp, shead->index);
+ }
} else {
- YASM_WRITE_16_L(bufp, entry->index);
+ YASM_WRITE_16_L(bufp, entry->index);
}
fwrite(buf, SYMTAB32_SIZE, 1, f);
size += SYMTAB32_SIZE;
YASM_WRITE_8(bufp, ELF64_ST_INFO(entry->bind, entry->type));
YASM_WRITE_8(bufp, 0);
if (entry->sect) {
- elf_secthead *shead =
- yasm_section_get_data(entry->sect, &elf_section_data);
- if (!shead)
- yasm_internal_error(
- N_("symbol references section without data"));
- YASM_WRITE_16_L(bufp, shead->index);
+ if (yasm_section_is_absolute(entry->sect)) {
+ YASM_WRITE_16_L(bufp, SHN_ABS);
+ } else {
+ elf_secthead *shead = yasm_section_get_data(entry->sect,
+ &elf_section_data);
+ if (!shead)
+ yasm_internal_error(
+ N_("symbol references section without data"));
+ YASM_WRITE_16_L(bufp, shead->index);
+ }
} else {
YASM_WRITE_16_L(bufp, entry->index);
}
EXTRA_DIST += modules/objfmts/elf/tests/elfglobext.hex
EXTRA_DIST += modules/objfmts/elf/tests/elfreloc-err.asm
EXTRA_DIST += modules/objfmts/elf/tests/elfreloc-err.errwarn
+EXTRA_DIST += modules/objfmts/elf/tests/elfabssect.asm
+EXTRA_DIST += modules/objfmts/elf/tests/elfabssect.errwarn
+EXTRA_DIST += modules/objfmts/elf/tests/elfabssect.hex
EXTRA_DIST += modules/objfmts/elf/tests/amd64/Makefile.inc
--- /dev/null
+%line 1+1 elfabssect.asm
+[absolute 0]
+%line 1+0 elfabssect.asm
+teststruc:
+%line 2+1 elfabssect.asm
+ .testlabel resw 1
+teststruc_size:
+%line 3+0 elfabssect.asm
+[section .text]
--- /dev/null
+7f
+45
+4c
+46
+01
+01
+01
+00
+00
+00
+00
+00
+00
+00
+00
+00
+01
+00
+03
+00
+01
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+c0
+00
+00
+00
+00
+00
+00
+00
+34
+00
+00
+00
+00
+00
+28
+00
+05
+00
+01
+00
+00
+2e
+74
+65
+78
+74
+00
+2e
+73
+74
+72
+74
+61
+62
+00
+2e
+73
+79
+6d
+74
+61
+62
+00
+2e
+73
+68
+73
+74
+72
+74
+61
+62
+00
+00
+00
+00
+00
+2d
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+01
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+04
+00
+f1
+ff
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+03
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+f1
+ff
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+f1
+ff
+00
+00
+00
+00
+02
+00
+00
+00
+00
+00
+00
+00
+00
+00
+f1
+ff
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+17
+00
+00
+00
+03
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+34
+00
+00
+00
+21
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+07
+00
+00
+00
+03
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+58
+00
+00
+00
+03
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+0f
+00
+00
+00
+02
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+5c
+00
+00
+00
+60
+00
+00
+00
+02
+00
+00
+00
+06
+00
+00
+00
+04
+00
+00
+00
+10
+00
+00
+00
+01
+00
+00
+00
+01
+00
+00
+00
+06
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+10
+00
+00
+00
+00
+00
+00
+00