History

don't discard SHT_((PRE)INIT|FINI)_ARRAY sections

Daniel Glöckner committed 16 years ago

Commit a867f421 parent 128e46f2 files · +9 −1Browse files

Unified · Split

2 files
  1. elf.h +6 −1
  2. tccelf.c +3 −0
elf.h+6−1
@@ -318,7 +318,12 @@ typedef struct · 317 unmodified lines
318#define SHT_REL 9 /* Relocation entries, no addends */318#define SHT_REL 9 /* Relocation entries, no addends */
319#define SHT_SHLIB 10 /* Reserved */319#define SHT_SHLIB 10 /* Reserved */
320#define SHT_DYNSYM 11 /* Dynamic linker symbol table */320#define SHT_DYNSYM 11 /* Dynamic linker symbol table */
321#define SHT_NUM 12 /* Number of defined types. */321#define SHT_INIT_ARRAY 14 /* Array of constructors */
322#define SHT_FINI_ARRAY 15 /* Array of destructors */
323#define SHT_PREINIT_ARRAY 16 /* Array of pre-constructors */
324#define SHT_GROUP 17 /* Section group */
325#define SHT_SYMTAB_SHNDX 18 /* Extended section indices */
326#define SHT_NUM 19 /* Number of defined types. */
322#define SHT_LOOS 0x60000000 /* Start OS-specific */327#define SHT_LOOS 0x60000000 /* Start OS-specific */
323#define SHT_LOSUNW 0x6ffffffb /* Sun-specific low bound. */328#define SHT_LOSUNW 0x6ffffffb /* Sun-specific low bound. */
324#define SHT_SUNW_COMDAT 0x6ffffffb329#define SHT_SUNW_COMDAT 0x6ffffffb
tccelf.c+3−0
@@ -2321,6 +2321,9 @@ ST_FUNC int tcc_load_object_file(TCCState *s1, · 2320 unmodified lines
2321 sh->sh_type != SHT_ARM_EXIDX &&2321 sh->sh_type != SHT_ARM_EXIDX &&
2322#endif2322#endif
2323 sh->sh_type != SHT_NOBITS && 2323 sh->sh_type != SHT_NOBITS &&
2324 sh->sh_type != SHT_PREINIT_ARRAY &&
2325 sh->sh_type != SHT_INIT_ARRAY &&
2326 sh->sh_type != SHT_FINI_ARRAY &&
2324 strcmp(sh_name, ".stabstr")2327 strcmp(sh_name, ".stabstr")
2325 )2328 )
2326 continue;2329 continue;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t