A Bluesky Playdate client
at main 2.1 kB view raw
1/* 2 NOTE(Daniel Bokser): It seems that due to the way the Zig now invokes the linker, 3 the entry point name must be specified in build.zig. Thus, the ENTRY() call here is no longer needed. 4 5 ENTRY(eventHandler) 6*/ 7 8/* 9 NOTE(Daniel Bokser): This GROUP line is from the PlaydateSDK. This doesn't seem to be required for Zig. 10 But, leaving it here just in case... 11 12 GROUP(libgcc.a libc.a libm.a) 13*/ 14 15/* 16 NOTE(Daniel Bokser): Had to add this PHDRS contstruct in to force however Zig invokes the linker 17 to make sure there is only one combined ELF segment, which is what PDC seems to expect. 18*/ 19PHDRS 20{ 21 global_segment PT_LOAD; 22} 23SECTIONS 24{ 25 /* 26 NOTE(Daniel Bokser): Had to add this in to force however Zig now invokes the linker 27 to make sure everything starts at address 0, which is what PDC seems to expect. 28 */ 29 . = 0; 30 31 .text : 32 { 33 *(.text) 34 *(.text.*) 35 36 KEEP(*(.init)) 37 KEEP(*(.fini)) 38 39 /* .ctors */ 40 *crtbegin.o(.ctors) 41 *crtbegin?.o(.ctors) 42 *(EXCLUDE_FILE(*crtend?.o *crtend.o) .ctors) 43 *(SORT(.ctors.*)) 44 *(.ctors) 45 46 /* .dtors */ 47 *crtbegin.o(.dtors) 48 *crtbegin?.o(.dtors) 49 *(EXCLUDE_FILE(*crtend?.o *crtend.o) .dtors) 50 *(SORT(.dtors.*)) 51 *(.dtors) 52 53 *(.rodata*) 54 55 KEEP(*(.eh_frame*)) 56 57 }: global_segment 58 59 .data : 60 { 61 __etext = .; 62 63 __data_start__ = .; 64 *(vtable) 65 *(.data*) 66 67 . = ALIGN(4); 68 /* preinit data */ 69 PROVIDE_HIDDEN (__preinit_array_start = .); 70 KEEP(*(.preinit_array)) 71 PROVIDE_HIDDEN (__preinit_array_end = .); 72 73 . = ALIGN(4); 74 /* init data */ 75 PROVIDE_HIDDEN (__init_array_start = .); 76 KEEP(*(SORT(.init_array.*))) 77 KEEP(*(.init_array)) 78 PROVIDE_HIDDEN (__init_array_end = .); 79 80 . = ALIGN(4); 81 /* finit data */ 82 PROVIDE_HIDDEN (__fini_array_start = .); 83 KEEP(*(SORT(.fini_array.*))) 84 KEEP(*(.fini_array)) 85 PROVIDE_HIDDEN (__fini_array_end = .); 86 87 . = ALIGN(4); 88 /* All data end */ 89 __data_end__ = .; 90 91 }: global_segment 92 93 .bss : 94 { 95 . = ALIGN(4); 96 __bss_start__ = .; 97 *(.bss*) 98 *(COMMON) 99 *(COM) 100 . = ALIGN(4); 101 __bss_end__ = .; 102 103 }: global_segment 104 105 /DISCARD/ : 106 { 107 *(.ARM.exidx) 108 } 109 110}