MAKEDEP = $(CC) -M
-ASFLAGS := -felf -D ARCHDIR=$(ARCHDIR)
+ASFLAGS += -D ARCHDIR=$(ARCHDIR)
CPPFLAGS := -I$(ACESSDIR)/Usermode/include/ -D ARCHDIR=$(ARCHDIR) -D ARCHDIR_IS_$(ARCHDIR)=1
CFLAGS := -g -Wall -fPIC -fno-builtin -fno-stack-protector $(CPPFLAGS)
LDFLAGS := -g -nostdlib -shared -I/Acess/Libs/ld-acess.so -e SoMain -x -L$(OUTPUTDIR)Libs/
install: $(BIN)
-$(BIN): acess.ld.h
+$(BIN): acess_$(ARCHDIR).ld.h
@mkdir -p $(dir $(BIN))
cpp -nostdinc -U i386 -P -C $< -o $@ -D__LIBDIR=$(OUTPUTDIR)Libs
+++ /dev/null
-OUTPUT_FORMAT("elf32-i386", "elf32-i386", "elf32-i386")\r
-OUTPUT_ARCH(i386)\r
-ENTRY(start)\r
-SEARCH_DIR(__LIBDIR)\r
-INPUT(crt0.o)\r
-SECTIONS\r
-{\r
- /* Read-only sections, merged into text segment: */\r
- PROVIDE (__executable_start = 0x08048000); . = 0x08048000 + SIZEOF_HEADERS;\r
- .interp : { *(.interp) }\r
- .note.gnu.build-id : { *(.note.gnu.build-id) }\r
- .hash : { *(.hash) }\r
- .gnu.hash : { *(.gnu.hash) }\r
- .dynsym : { *(.dynsym) }\r
- .dynstr : { *(.dynstr) }\r
- .gnu.version : { *(.gnu.version) }\r
- .gnu.version_d : { *(.gnu.version_d) }\r
- .gnu.version_r : { *(.gnu.version_r) }\r
- .rel.dyn :\r
- {\r
- *(.rel.init)\r
- *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*)\r
- *(.rel.fini)\r
- *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*)\r
- *(.rel.data.rel.ro* .rel.gnu.linkonce.d.rel.ro.*)\r
- *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*)\r
- *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*)\r
- *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*)\r
- *(.rel.ctors)\r
- *(.rel.dtors)\r
- *(.rel.got)\r
- *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*)\r
- }\r
- .rela.dyn :\r
- {\r
- *(.rela.init)\r
- *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*)\r
- *(.rela.fini)\r
- *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*)\r
- *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*)\r
- *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*)\r
- *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*)\r
- *(.rela.ctors)\r
- *(.rela.dtors)\r
- *(.rela.got)\r
- *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*)\r
- }\r
- .rel.plt : { *(.rel.plt) }\r
- .rela.plt : { *(.rela.plt) }\r
- .init :\r
- {\r
- KEEP (*(.init))\r
- } =0x90909090\r
- .plt : { *(.plt) }\r
- .text :\r
- {\r
- *(.text .stub .text.* .gnu.linkonce.t.*)\r
- /* .gnu.warning sections are handled specially by elf32.em. */\r
- *(.gnu.warning)\r
- } =0x90909090\r
- .fini :\r
- {\r
- KEEP (*(.fini))\r
- } =0x90909090\r
- PROVIDE (__etext = .);\r
- PROVIDE (_etext = .);\r
- PROVIDE (etext = .);\r
- .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) }\r
- .rodata1 : { *(.rodata1) }\r
- .eh_frame_hdr : { *(.eh_frame_hdr) }\r
- .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) }\r
- .gcc_except_table : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) }\r
- /* Adjust the address for the data segment. We want to adjust up to\r
- the same address within the page on the next page up. */\r
- . = ALIGN (CONSTANT (MAXPAGESIZE)) - ((CONSTANT (MAXPAGESIZE) - .) & (CONSTANT (MAXPAGESIZE) - 1)); . = DATA_SEGMENT_ALIGN (CONSTANT (MAXPAGESIZE), CONSTANT (COMMONPAGESIZE));\r
- /* Exception handling */\r
- .eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) }\r
- .gcc_except_table : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) }\r
- /* Thread Local Storage sections */\r
- .tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) }\r
- .tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }\r
- .preinit_array :\r
- {\r
- PROVIDE_HIDDEN (__preinit_array_start = .);\r
- KEEP (*(.preinit_array))\r
- PROVIDE_HIDDEN (__preinit_array_end = .);\r
- }\r
- .init_array :\r
- {\r
- PROVIDE_HIDDEN (__init_array_start = .);\r
- KEEP (*(SORT(.init_array.*)))\r
- KEEP (*(.init_array))\r
- PROVIDE_HIDDEN (__init_array_end = .);\r
- }\r
- .fini_array :\r
- {\r
- PROVIDE_HIDDEN (__fini_array_start = .);\r
- KEEP (*(.fini_array))\r
- KEEP (*(SORT(.fini_array.*)))\r
- PROVIDE_HIDDEN (__fini_array_end = .);\r
- }\r
- .ctors :\r
- {\r
- /* gcc uses crtbegin.o to find the start of\r
- the constructors, so we make sure it is\r
- first. Because this is a wildcard, it\r
- doesn't matter if the user does not\r
- actually link against crtbegin.o; the\r
- linker won't look for a file to match a\r
- wildcard. The wildcard also means that it\r
- doesn't matter which directory crtbegin.o\r
- is in. */\r
- KEEP (*crtbegin.o(.ctors))\r
- KEEP (*crtbegin?.o(.ctors))\r
- /* We don't want to include the .ctor section from\r
- the crtend.o file until after the sorted ctors.\r
- The .ctor section from the crtend file contains the\r
- end of ctors marker and it must be last */\r
- KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors))\r
- KEEP (*(SORT(.ctors.*)))\r
- KEEP (*(.ctors))\r
- }\r
- .dtors :\r
- {\r
- KEEP (*crtbegin.o(.dtors))\r
- KEEP (*crtbegin?.o(.dtors))\r
- KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors))\r
- KEEP (*(SORT(.dtors.*)))\r
- KEEP (*(.dtors))\r
- }\r
- .jcr : { KEEP (*(.jcr)) }\r
- .data.rel.ro : { *(.data.rel.ro.local* .gnu.linkonce.d.rel.ro.local.*) *(.data.rel.ro* .gnu.linkonce.d.rel.ro.*) }\r
- .dynamic : { *(.dynamic) }\r
- .got : { *(.got) }\r
- . = DATA_SEGMENT_RELRO_END (12, .);\r
- .got.plt : { *(.got.plt) }\r
- .data :\r
- {\r
- *(.data .data.* .gnu.linkonce.d.*)\r
- SORT(CONSTRUCTORS)\r
- }\r
- .data1 : { *(.data1) }\r
- _edata = .; PROVIDE (edata = .);\r
- __bss_start = .;\r
- .bss :\r
- {\r
- *(.dynbss)\r
- *(.bss .bss.* .gnu.linkonce.b.*)\r
- *(COMMON)\r
- /* Align here to ensure that the .bss section occupies space up to\r
- _end. Align after .bss to ensure correct alignment even if the\r
- .bss section disappears because there are no input sections.\r
- FIXME: Why do we need it? When there is no .bss section, we don't\r
- pad the .data section. */\r
- . = ALIGN(. != 0 ? 32 / 8 : 1);\r
- }\r
- . = ALIGN(32 / 8);\r
- . = ALIGN(32 / 8);\r
- _end = .; PROVIDE (end = .);\r
- . = DATA_SEGMENT_END (.);\r
- /* Stabs debugging sections. */\r
- .stab 0 : { *(.stab) }\r
- .stabstr 0 : { *(.stabstr) }\r
- .stab.excl 0 : { *(.stab.excl) }\r
- .stab.exclstr 0 : { *(.stab.exclstr) }\r
- .stab.index 0 : { *(.stab.index) }\r
- .stab.indexstr 0 : { *(.stab.indexstr) }\r
- .comment 0 : { *(.comment) }\r
- /* DWARF debug sections.\r
- Symbols in the DWARF debugging sections are relative to the beginning\r
- of the section so we begin them at 0. */\r
- /* DWARF 1 */\r
- .debug 0 : { *(.debug) }\r
- .line 0 : { *(.line) }\r
- /* GNU DWARF 1 extensions */\r
- .debug_srcinfo 0 : { *(.debug_srcinfo) }\r
- .debug_sfnames 0 : { *(.debug_sfnames) }\r
- /* DWARF 1.1 and DWARF 2 */\r
- .debug_aranges 0 : { *(.debug_aranges) }\r
- .debug_pubnames 0 : { *(.debug_pubnames) }\r
- /* DWARF 2 */\r
- .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }\r
- .debug_abbrev 0 : { *(.debug_abbrev) }\r
- .debug_line 0 : { *(.debug_line) }\r
- .debug_frame 0 : { *(.debug_frame) }\r
- .debug_str 0 : { *(.debug_str) }\r
- .debug_loc 0 : { *(.debug_loc) }\r
- .debug_macinfo 0 : { *(.debug_macinfo) }\r
- /* SGI/MIPS DWARF 2 extensions */\r
- .debug_weaknames 0 : { *(.debug_weaknames) }\r
- .debug_funcnames 0 : { *(.debug_funcnames) }\r
- .debug_typenames 0 : { *(.debug_typenames) }\r
- .debug_varnames 0 : { *(.debug_varnames) }\r
- /* DWARF 3 */\r
- .debug_pubtypes 0 : { *(.debug_pubtypes) }\r
- .debug_ranges 0 : { *(.debug_ranges) }\r
- .gnu.attributes 0 : { KEEP (*(.gnu.attributes)) }\r
- /DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) }\r
-}\r
--- /dev/null
+OUTPUT_FORMAT("elf32-i386", "elf32-i386", "elf32-i386")\r
+OUTPUT_ARCH(i386)\r
+ENTRY(start)\r
+SEARCH_DIR(__LIBDIR)\r
+INPUT(crt0.o)\r
+SECTIONS\r
+{\r
+ /* Read-only sections, merged into text segment: */\r
+ PROVIDE (__executable_start = 0x08048000); . = 0x08048000 + SIZEOF_HEADERS;\r
+ .interp : { *(.interp) }\r
+ .note.gnu.build-id : { *(.note.gnu.build-id) }\r
+ .hash : { *(.hash) }\r
+ .gnu.hash : { *(.gnu.hash) }\r
+ .dynsym : { *(.dynsym) }\r
+ .dynstr : { *(.dynstr) }\r
+ .gnu.version : { *(.gnu.version) }\r
+ .gnu.version_d : { *(.gnu.version_d) }\r
+ .gnu.version_r : { *(.gnu.version_r) }\r
+ .rel.dyn :\r
+ {\r
+ *(.rel.init)\r
+ *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*)\r
+ *(.rel.fini)\r
+ *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*)\r
+ *(.rel.data.rel.ro* .rel.gnu.linkonce.d.rel.ro.*)\r
+ *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*)\r
+ *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*)\r
+ *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*)\r
+ *(.rel.ctors)\r
+ *(.rel.dtors)\r
+ *(.rel.got)\r
+ *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*)\r
+ }\r
+ .rela.dyn :\r
+ {\r
+ *(.rela.init)\r
+ *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*)\r
+ *(.rela.fini)\r
+ *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*)\r
+ *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*)\r
+ *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*)\r
+ *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*)\r
+ *(.rela.ctors)\r
+ *(.rela.dtors)\r
+ *(.rela.got)\r
+ *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*)\r
+ }\r
+ .rel.plt : { *(.rel.plt) }\r
+ .rela.plt : { *(.rela.plt) }\r
+ .init :\r
+ {\r
+ KEEP (*(.init))\r
+ } =0x90909090\r
+ .plt : { *(.plt) }\r
+ .text :\r
+ {\r
+ *(.text .stub .text.* .gnu.linkonce.t.*)\r
+ /* .gnu.warning sections are handled specially by elf32.em. */\r
+ *(.gnu.warning)\r
+ } =0x90909090\r
+ .fini :\r
+ {\r
+ KEEP (*(.fini))\r
+ } =0x90909090\r
+ PROVIDE (__etext = .);\r
+ PROVIDE (_etext = .);\r
+ PROVIDE (etext = .);\r
+ .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) }\r
+ .rodata1 : { *(.rodata1) }\r
+ .eh_frame_hdr : { *(.eh_frame_hdr) }\r
+ .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) }\r
+ .gcc_except_table : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) }\r
+ /* Adjust the address for the data segment. We want to adjust up to\r
+ the same address within the page on the next page up. */\r
+ . = ALIGN (CONSTANT (MAXPAGESIZE)) - ((CONSTANT (MAXPAGESIZE) - .) & (CONSTANT (MAXPAGESIZE) - 1)); . = DATA_SEGMENT_ALIGN (CONSTANT (MAXPAGESIZE), CONSTANT (COMMONPAGESIZE));\r
+ /* Exception handling */\r
+ .eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) }\r
+ .gcc_except_table : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) }\r
+ /* Thread Local Storage sections */\r
+ .tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) }\r
+ .tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }\r
+ .preinit_array :\r
+ {\r
+ PROVIDE_HIDDEN (__preinit_array_start = .);\r
+ KEEP (*(.preinit_array))\r
+ PROVIDE_HIDDEN (__preinit_array_end = .);\r
+ }\r
+ .init_array :\r
+ {\r
+ PROVIDE_HIDDEN (__init_array_start = .);\r
+ KEEP (*(SORT(.init_array.*)))\r
+ KEEP (*(.init_array))\r
+ PROVIDE_HIDDEN (__init_array_end = .);\r
+ }\r
+ .fini_array :\r
+ {\r
+ PROVIDE_HIDDEN (__fini_array_start = .);\r
+ KEEP (*(.fini_array))\r
+ KEEP (*(SORT(.fini_array.*)))\r
+ PROVIDE_HIDDEN (__fini_array_end = .);\r
+ }\r
+ .ctors :\r
+ {\r
+ /* gcc uses crtbegin.o to find the start of\r
+ the constructors, so we make sure it is\r
+ first. Because this is a wildcard, it\r
+ doesn't matter if the user does not\r
+ actually link against crtbegin.o; the\r
+ linker won't look for a file to match a\r
+ wildcard. The wildcard also means that it\r
+ doesn't matter which directory crtbegin.o\r
+ is in. */\r
+ KEEP (*crtbegin.o(.ctors))\r
+ KEEP (*crtbegin?.o(.ctors))\r
+ /* We don't want to include the .ctor section from\r
+ the crtend.o file until after the sorted ctors.\r
+ The .ctor section from the crtend file contains the\r
+ end of ctors marker and it must be last */\r
+ KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors))\r
+ KEEP (*(SORT(.ctors.*)))\r
+ KEEP (*(.ctors))\r
+ }\r
+ .dtors :\r
+ {\r
+ KEEP (*crtbegin.o(.dtors))\r
+ KEEP (*crtbegin?.o(.dtors))\r
+ KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors))\r
+ KEEP (*(SORT(.dtors.*)))\r
+ KEEP (*(.dtors))\r
+ }\r
+ .jcr : { KEEP (*(.jcr)) }\r
+ .data.rel.ro : { *(.data.rel.ro.local* .gnu.linkonce.d.rel.ro.local.*) *(.data.rel.ro* .gnu.linkonce.d.rel.ro.*) }\r
+ .dynamic : { *(.dynamic) }\r
+ .got : { *(.got) }\r
+ . = DATA_SEGMENT_RELRO_END (12, .);\r
+ .got.plt : { *(.got.plt) }\r
+ .data :\r
+ {\r
+ *(.data .data.* .gnu.linkonce.d.*)\r
+ SORT(CONSTRUCTORS)\r
+ }\r
+ .data1 : { *(.data1) }\r
+ _edata = .; PROVIDE (edata = .);\r
+ __bss_start = .;\r
+ .bss :\r
+ {\r
+ *(.dynbss)\r
+ *(.bss .bss.* .gnu.linkonce.b.*)\r
+ *(COMMON)\r
+ /* Align here to ensure that the .bss section occupies space up to\r
+ _end. Align after .bss to ensure correct alignment even if the\r
+ .bss section disappears because there are no input sections.\r
+ FIXME: Why do we need it? When there is no .bss section, we don't\r
+ pad the .data section. */\r
+ . = ALIGN(. != 0 ? 32 / 8 : 1);\r
+ }\r
+ . = ALIGN(32 / 8);\r
+ . = ALIGN(32 / 8);\r
+ _end = .; PROVIDE (end = .);\r
+ . = DATA_SEGMENT_END (.);\r
+ /* Stabs debugging sections. */\r
+ .stab 0 : { *(.stab) }\r
+ .stabstr 0 : { *(.stabstr) }\r
+ .stab.excl 0 : { *(.stab.excl) }\r
+ .stab.exclstr 0 : { *(.stab.exclstr) }\r
+ .stab.index 0 : { *(.stab.index) }\r
+ .stab.indexstr 0 : { *(.stab.indexstr) }\r
+ .comment 0 : { *(.comment) }\r
+ /* DWARF debug sections.\r
+ Symbols in the DWARF debugging sections are relative to the beginning\r
+ of the section so we begin them at 0. */\r
+ /* DWARF 1 */\r
+ .debug 0 : { *(.debug) }\r
+ .line 0 : { *(.line) }\r
+ /* GNU DWARF 1 extensions */\r
+ .debug_srcinfo 0 : { *(.debug_srcinfo) }\r
+ .debug_sfnames 0 : { *(.debug_sfnames) }\r
+ /* DWARF 1.1 and DWARF 2 */\r
+ .debug_aranges 0 : { *(.debug_aranges) }\r
+ .debug_pubnames 0 : { *(.debug_pubnames) }\r
+ /* DWARF 2 */\r
+ .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }\r
+ .debug_abbrev 0 : { *(.debug_abbrev) }\r
+ .debug_line 0 : { *(.debug_line) }\r
+ .debug_frame 0 : { *(.debug_frame) }\r
+ .debug_str 0 : { *(.debug_str) }\r
+ .debug_loc 0 : { *(.debug_loc) }\r
+ .debug_macinfo 0 : { *(.debug_macinfo) }\r
+ /* SGI/MIPS DWARF 2 extensions */\r
+ .debug_weaknames 0 : { *(.debug_weaknames) }\r
+ .debug_funcnames 0 : { *(.debug_funcnames) }\r
+ .debug_typenames 0 : { *(.debug_typenames) }\r
+ .debug_varnames 0 : { *(.debug_varnames) }\r
+ /* DWARF 3 */\r
+ .debug_pubtypes 0 : { *(.debug_pubtypes) }\r
+ .debug_ranges 0 : { *(.debug_ranges) }\r
+ .gnu.attributes 0 : { KEEP (*(.gnu.attributes)) }\r
+ /DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) }\r
+}\r
--- /dev/null
+OUTPUT_FORMAT("elf64-x86_64")\r
+OUTPUT_ARCH(x86_64)\r
+ENTRY(start)\r
+SEARCH_DIR(__LIBDIR)\r
+INPUT(crt0.o)\r
+SECTIONS\r
+{\r
+ /* Read-only sections, merged into text segment: */\r
+ PROVIDE (__executable_start = 0x00400000); . = 0x00400000 + SIZEOF_HEADERS;\r
+ .interp : { *(.interp) }\r
+ .note.gnu.build-id : { *(.note.gnu.build-id) }\r
+ .hash : { *(.hash) }\r
+ .gnu.hash : { *(.gnu.hash) }\r
+ .dynsym : { *(.dynsym) }\r
+ .dynstr : { *(.dynstr) }\r
+ .gnu.version : { *(.gnu.version) }\r
+ .gnu.version_d : { *(.gnu.version_d) }\r
+ .gnu.version_r : { *(.gnu.version_r) }\r
+ .rel.dyn :\r
+ {\r
+ *(.rel.init)\r
+ *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*)\r
+ *(.rel.fini)\r
+ *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*)\r
+ *(.rel.data.rel.ro* .rel.gnu.linkonce.d.rel.ro.*)\r
+ *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*)\r
+ *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*)\r
+ *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*)\r
+ *(.rel.ctors)\r
+ *(.rel.dtors)\r
+ *(.rel.got)\r
+ *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*)\r
+ }\r
+ .rela.dyn :\r
+ {\r
+ *(.rela.init)\r
+ *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*)\r
+ *(.rela.fini)\r
+ *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*)\r
+ *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*)\r
+ *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*)\r
+ *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*)\r
+ *(.rela.ctors)\r
+ *(.rela.dtors)\r
+ *(.rela.got)\r
+ *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*)\r
+ }\r
+ .rel.plt : { *(.rel.plt) }\r
+ .rela.plt : { *(.rela.plt) }\r
+ .init :\r
+ {\r
+ KEEP (*(.init))\r
+ } =0x90909090\r
+ .plt : { *(.plt) }\r
+ .text :\r
+ {\r
+ *(.text .stub .text.* .gnu.linkonce.t.*)\r
+ /* .gnu.warning sections are handled specially by elf32.em. */\r
+ *(.gnu.warning)\r
+ } =0x90909090\r
+ .fini :\r
+ {\r
+ KEEP (*(.fini))\r
+ } =0x90909090\r
+ PROVIDE (__etext = .);\r
+ PROVIDE (_etext = .);\r
+ PROVIDE (etext = .);\r
+ .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) }\r
+ .rodata1 : { *(.rodata1) }\r
+ .eh_frame_hdr : { *(.eh_frame_hdr) }\r
+ .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) }\r
+ .gcc_except_table : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) }\r
+ /* Adjust the address for the data segment. We want to adjust up to\r
+ the same address within the page on the next page up. */\r
+ . = ALIGN (CONSTANT (MAXPAGESIZE)) - ((CONSTANT (MAXPAGESIZE) - .) & (CONSTANT (MAXPAGESIZE) - 1)); . = DATA_SEGMENT_ALIGN (CONSTANT (MAXPAGESIZE), CONSTANT (COMMONPAGESIZE));\r
+ /* Exception handling */\r
+ .eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) }\r
+ .gcc_except_table : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) }\r
+ /* Thread Local Storage sections */\r
+ .tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) }\r
+ .tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }\r
+ .preinit_array :\r
+ {\r
+ PROVIDE_HIDDEN (__preinit_array_start = .);\r
+ KEEP (*(.preinit_array))\r
+ PROVIDE_HIDDEN (__preinit_array_end = .);\r
+ }\r
+ .init_array :\r
+ {\r
+ PROVIDE_HIDDEN (__init_array_start = .);\r
+ KEEP (*(SORT(.init_array.*)))\r
+ KEEP (*(.init_array))\r
+ PROVIDE_HIDDEN (__init_array_end = .);\r
+ }\r
+ .fini_array :\r
+ {\r
+ PROVIDE_HIDDEN (__fini_array_start = .);\r
+ KEEP (*(.fini_array))\r
+ KEEP (*(SORT(.fini_array.*)))\r
+ PROVIDE_HIDDEN (__fini_array_end = .);\r
+ }\r
+ .ctors :\r
+ {\r
+ /* gcc uses crtbegin.o to find the start of\r
+ the constructors, so we make sure it is\r
+ first. Because this is a wildcard, it\r
+ doesn't matter if the user does not\r
+ actually link against crtbegin.o; the\r
+ linker won't look for a file to match a\r
+ wildcard. The wildcard also means that it\r
+ doesn't matter which directory crtbegin.o\r
+ is in. */\r
+ KEEP (*crtbegin.o(.ctors))\r
+ KEEP (*crtbegin?.o(.ctors))\r
+ /* We don't want to include the .ctor section from\r
+ the crtend.o file until after the sorted ctors.\r
+ The .ctor section from the crtend file contains the\r
+ end of ctors marker and it must be last */\r
+ KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors))\r
+ KEEP (*(SORT(.ctors.*)))\r
+ KEEP (*(.ctors))\r
+ }\r
+ .dtors :\r
+ {\r
+ KEEP (*crtbegin.o(.dtors))\r
+ KEEP (*crtbegin?.o(.dtors))\r
+ KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors))\r
+ KEEP (*(SORT(.dtors.*)))\r
+ KEEP (*(.dtors))\r
+ }\r
+ .jcr : { KEEP (*(.jcr)) }\r
+ .data.rel.ro : { *(.data.rel.ro.local* .gnu.linkonce.d.rel.ro.local.*) *(.data.rel.ro* .gnu.linkonce.d.rel.ro.*) }\r
+ .dynamic : { *(.dynamic) }\r
+ .got : { *(.got) }\r
+ . = DATA_SEGMENT_RELRO_END (12, .);\r
+ .got.plt : { *(.got.plt) }\r
+ .data :\r
+ {\r
+ *(.data .data.* .gnu.linkonce.d.*)\r
+ SORT(CONSTRUCTORS)\r
+ }\r
+ .data1 : { *(.data1) }\r
+ _edata = .; PROVIDE (edata = .);\r
+ __bss_start = .;\r
+ .bss :\r
+ {\r
+ *(.dynbss)\r
+ *(.bss .bss.* .gnu.linkonce.b.*)\r
+ *(COMMON)\r
+ /* Align here to ensure that the .bss section occupies space up to\r
+ _end. Align after .bss to ensure correct alignment even if the\r
+ .bss section disappears because there are no input sections.\r
+ FIXME: Why do we need it? When there is no .bss section, we don't\r
+ pad the .data section. */\r
+ . = ALIGN(. != 0 ? 32 / 8 : 1);\r
+ }\r
+ . = ALIGN(32 / 8);\r
+ . = ALIGN(32 / 8);\r
+ _end = .; PROVIDE (end = .);\r
+ . = DATA_SEGMENT_END (.);\r
+ /* Stabs debugging sections. */\r
+ .stab 0 : { *(.stab) }\r
+ .stabstr 0 : { *(.stabstr) }\r
+ .stab.excl 0 : { *(.stab.excl) }\r
+ .stab.exclstr 0 : { *(.stab.exclstr) }\r
+ .stab.index 0 : { *(.stab.index) }\r
+ .stab.indexstr 0 : { *(.stab.indexstr) }\r
+ .comment 0 : { *(.comment) }\r
+ /* DWARF debug sections.\r
+ Symbols in the DWARF debugging sections are relative to the beginning\r
+ of the section so we begin them at 0. */\r
+ /* DWARF 1 */\r
+ .debug 0 : { *(.debug) }\r
+ .line 0 : { *(.line) }\r
+ /* GNU DWARF 1 extensions */\r
+ .debug_srcinfo 0 : { *(.debug_srcinfo) }\r
+ .debug_sfnames 0 : { *(.debug_sfnames) }\r
+ /* DWARF 1.1 and DWARF 2 */\r
+ .debug_aranges 0 : { *(.debug_aranges) }\r
+ .debug_pubnames 0 : { *(.debug_pubnames) }\r
+ /* DWARF 2 */\r
+ .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }\r
+ .debug_abbrev 0 : { *(.debug_abbrev) }\r
+ .debug_line 0 : { *(.debug_line) }\r
+ .debug_frame 0 : { *(.debug_frame) }\r
+ .debug_str 0 : { *(.debug_str) }\r
+ .debug_loc 0 : { *(.debug_loc) }\r
+ .debug_macinfo 0 : { *(.debug_macinfo) }\r
+ /* SGI/MIPS DWARF 2 extensions */\r
+ .debug_weaknames 0 : { *(.debug_weaknames) }\r
+ .debug_funcnames 0 : { *(.debug_funcnames) }\r
+ .debug_typenames 0 : { *(.debug_typenames) }\r
+ .debug_varnames 0 : { *(.debug_varnames) }\r
+ /* DWARF 3 */\r
+ .debug_pubtypes 0 : { *(.debug_pubtypes) }\r
+ .debug_ranges 0 : { *(.debug_ranges) }\r
+ .gnu.attributes 0 : { KEEP (*(.gnu.attributes)) }\r
+ /DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) }\r
+}\r
*/\r
EXPORT int vfprintf(FILE *fp, const char *format, va_list args)\r
{\r
- va_list tmpList = args;\r
+ va_list tmpList;\r
int size;\r
char sbuf[1024];\r
char *buf = sbuf;\r
- \r
+ \r
+\r
+\r
if(!fp || !format) return -1;\r
+\r
+ va_copy(tmpList, args);\r
\r
size = vsnprintf(sbuf, 1024, (char*)format, tmpList);\r
\r
i = strlen(str)-1;
while(i--)
{
- if(str[i] == character) return &str[i];
+ if(str[i] == character)
+ return (void*)&str[i];
}
return NULL;
}
while(num--)
{
if( *(const unsigned char*)ptr == (unsigned char)value )
- return ptr;
+ return (void*)ptr;
ptr ++;
}
return NULL;