mirror of
https://github.com/netwide-assembler/nasm.git
synced 2024-12-21 09:19:31 +08:00
b2004511dd
Dead code elimination in ELF uses separate ELF sections for every functions or data items that may be garbage collected. This can end up being more than 32,633 sections which, when the ELF internal and relocation sections are added in, can exceed the legacy ELF maximum of 65,279 sections. Newer versions of the ELF specification has added support for much larger number of sections by putting a place holder value (usually SHN_XINDEX == 0xffff, but 0 in some cases) into fields where the section index is a 16-bit value, and storing the full value in a diffent place: the program header uses entries in section header 0, the symbol table uses an auxiliary segment with the additional indicies; the section header did not need it as the sh_link field is already 32 (or 64) bits long. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
16 lines
223 B
NASM
16 lines
223 B
NASM
%ifndef NSECS
|
|
%assign NSECS 16384
|
|
%endif
|
|
|
|
%assign NSECS ((NSECS+3) & ~3)
|
|
|
|
%assign n 0
|
|
%rep NSECS
|
|
%assign gcom (n & ~3) + 2
|
|
section .text %+ n progbits exec
|
|
start_ %+ n:
|
|
nop
|
|
jmp start_ %+ gcom
|
|
%assign n n+1
|
|
%endrep
|