# config/link_order.ntsc.txt: the objects of the USA link, one per line, in link order.
#
# The USA disc (SLUS-20218) ships no linker map, so this order is PAL's
# (config/link_order.pal.txt on main, MAIN.MAP's object order) carried over by
# the function census, tools/correlate_elf.py: each PAL object keeps its place
# while its .text twins in the USA ELF keep the same relative order. A line
# that departs from PAL's order says why in a comment on the line. Every output
# section of config/link.ntsc.ld takes its inputs in this one order.
# tools/gen_ninja.py reads this file and fails on any tracked .c/.s/.dsm under
# ico2/ or sce/ that is missing here, and on any listed file that does not
# exist. tools/ico_version.{py,sh} detect the target (ntsc) by this file's
# existence.
#
# Line forms:
#   <path>             a source file (.c compiled by tools/compile_c.sh, .s
#                      assembled per archive, ico2/vusrc/*.dsm by dvp-as)
#   data:<member>      a data-only ico2000.a member: every row of
#                      config/data_members.ntsc.txt for it, generated from the
#                      user's base ELF at build time by tools/gen_data_c.py from
#                      the record types config/data_schema.ntsc.txt names. The
#                      data: lines are PAL's members in PAL's places, less the
#                      two this build lacks and with the two moves
#                      config/data_members.ntsc.txt derives.
#
# Token after a path:
#   align.<sec>=16     the ROM starts this object's <sec> (data or rodata)
#                      16-aligned after fill that its own section alignment
#                      does not produce. While any line carries one,
#                      tools/gen_ninja.py lists that output section input by
#                      input (build/<sec>.inputs.ld, which the script
#                      INCLUDEs) with an ALIGN before the object; otherwise
#                      the file is empty and the script's wildcards alone
#                      place the section. Each token below was measured on
#                      the USA ELF, and its comment gives the USA addresses
#                      and the fill before it.
#   overlay-fill=N     on a .dsm line: the byte, decimal 0 to 255, that
#                      dvp-as repeats over the program's constant-address
#                      overlay section (--overlay-fill=N, from
#                      tools/binutils-dvp-overlay-fill.patch). It is the
#                      period assembler's uninitialised heap memory, measured
#                      on the disc's ELF, not a feature of the source. The
#                      USA ELF holds 0x6E (110) in all five, as the Japanese
#                      one does, where PAL's are zero; the seven continuation
#                      overlays are zero in all three.
#
# No object owns these zero runs at the section boundaries (ROM offsets, VMA
# minus 0x100000, from the USA ELF's section headers): 0x1746C0, the 64 bytes
# after .vutext (.reginfo is not allocated, the gap is fill); 0x4536B8, past the
# end of .data; 0x5318D0, past the end of .lit4. Every other run of fill inside
# a section is reproduced by the next object's own alignment or a token below.
#
# The USA build is older than the one PAL and JPN share: 1352 of PAL's 5755
# functions have no twin in it and 1039 of its functions have none in PAL. The
# census marks 15 PAL objects absent (no function with a twin). Each was looked
# for in the USA ELF by its PAL object's .data, .rodata, .sdata and .lit4 with
# every relocated field masked, and its .text by the sizes and order of the
# USA functions no PAL function claims, where its link order puts it:
#   present, in an earlier form (the line carries a comment saying why):
#     act-wish.c, attackhit.c, mail-add-data.c, flag.c, girlForceField.c,
#     handManager.c, st04e.c, st05e.c, st13a.c, st19a.c, st24a.c.
#   absent: puddle.c, waterDot.c, windmill.c and sce/libscf/libscf.c, whose
#     sources this branch does not carry (no USA function between their
#     neighbours' .text, no run of their sizes anywhere, and none of their
#     .data, .rodata, .sdata or .lit4 in the ELF).
#
# Departures from PAL's order:
#   ico2/omori/src/lws_kyomi.c sits between ico2/omori/src/access.c and
#   ico2/omori/src/objact.c, not between hand-camera.c and mail-add-data.c:
#   its one twin, SetParamKyomiGObj (body equal), lies in the USA .text
#   between access.c's last twin and objact.c's first, after two functions no
#   PAL function claims; PAL's place for it holds no function of its size or
#   order, and its PAL .rodata is not found there. Both places keep the
#   omori objects in name order (access, lws_kyomi, objact; gv, hand-camera,
#   mail-add-data, poly-flat).

sce/crt0.s
sce/libkernl/klib.s
sce/libkernl/initsys.c
sce/libkernl/intr.c
sce/libkernl/thread.c
sce/libkernl/kprintf.c
sce/libkernl/diei.c
sce/libkernl/deci2.c
ico2/common/src/main.c
ico2/sugipon/src/delayFreeManager.c
ico2/sugipon/src/geometryManager.c
ico2/sugipon/src/keyInput.c
# ico2/sugipon/src/matrixDrive.c .data starts 16-aligned at 0x275850, 8 B after its predecessor; the object's section is 8-aligned
ico2/sugipon/src/matrixDrive.c align.data=16
ico2/sugipon/src/motionManager2.c
ico2/sugipon/src/pool.c
ico2/sugipon/src/quaternion.c
ico2/sugipon/src/tableSin.c
ico2/seki/src/DisplayP2O.c
ico2/seki/src/FileManager.c
ico2/seki/src/GifPacket.c
ico2/seki/src/GsBase.c
ico2/seki/src/Light.c
# ico2/seki/src/Matrix.c .data starts 16-aligned at 0x2761D0, 12 B after its predecessor; the object's section is 8-aligned
ico2/seki/src/Matrix.c align.data=16
ico2/seki/src/MicroCode.c
ico2/seki/src/Packet.c
ico2/seki/src/Primitive.c
ico2/seki/src/RegistPacket.c
ico2/seki/src/Shadow.c
ico2/seki/src/StageAnimation.c
ico2/seki/src/Texture.c
ico2/seki/src/ZFog.c
ico2/fumi/ios/cdvd.c
ico2/fumi/ios/inflate.c
ico2/fumi/ios/ios.c
ico2/fumi/ios/mblock.c
ico2/fumi/ios/mcard.c
ico2/fumi/ios/mcdata.c
ico2/fumi/ios/memory.c
ico2/fumi/ios/message.c
ico2/fumi/ios/pad.c
ico2/fumi/ios/shockdriver.c
ico2/fumi/ios/thread.c
ico2/fumi/isys/gobj.c
ico2/fumi/isys/gobj_dl.c
ico2/fumi/isys/gobj_process.c
ico2/fumi/isys/isys.c
ico2/fumi/isys/obj_manager.c
ico2/fumi/sound/adpcm_init.c
ico2/fumi/sound/s_init.c
ico2/fumi/sound/soundManager.c
ico2/fumi/src/act-game.c
ico2/fumi/src/act-parallel-control.c
ico2/fumi/src/act-wish.c  # present, no twin: its PAL .rodata is at 0x5581D8 after act-parallel-control.c's; one USA function of 4336 B follows that object's .text
ico2/fumi/src/boyact.c
ico2/fumi/src/commonact.c
ico2/fumi/src/enemy_act.c
ico2/fumi/src/fieldCollision.c
ico2/fumi/src/fuzio.c
ico2/fumi/src/girl_act.c
ico2/fumi/src/jimaku.c
ico2/fumi/src/way_sys.c
ico2/fumi/src/way_util.c
ico2/script/src/gflag.c
ico2/script/src/script.c
ico2/script/src/st25a.c
ico2/script/src/warpGirl.c
ico2/omori/src/attackhit.c  # present, no twin: ten USA functions lie between warpGirl.c's and brain.c's .text where PAL has its eleven, with 8, 8 and 48 B in a row as Enemy/Boy/CommonAttackCenter (the last its body with immediates masked); its PAL .rodata is not found
ico2/omori/src/brain.c
ico2/omori/src/camera-editor.c
ico2/omori/src/camera-ico2.c
ico2/omori/src/camera-root.c
ico2/omori/src/camera-set-manager.c
ico2/omori/src/chain.c
ico2/omori/src/ebrain.c
ico2/omori/src/enemy-control.c
ico2/omori/src/fightSound.c
ico2/omori/src/generator.c
ico2/omori/src/gv.c
ico2/omori/src/hand-camera.c
ico2/omori/src/mail-add-data.c  # present, no twin: its PAL .rodata is at 0x55AF08 after generator.c's; four USA functions after hand-camera.c's .text have its four bodies with immediates masked
ico2/omori/src/poly-flat.c
ico2/ito/src/act_bird.c
ico2/ito/src/gather_effect.c
ico2/ito/src/itou_boss.c
ico2/ito/src/itou_gflag.c
ico2/ito/src/itou_sub.c
ico2/ito/src/lightning.c align.rodata=16  # USA: itou_sub.o's .rodata ends at 0x55C1B4 and lightning.o's starts at 0x55C1C0 (DrawLightning2's texture name)
ico2/ito/src/queen.c
ico2/ito/src/queen_barrier_disp.c
ico2/ito/src/stage_orient.c
ico2/ito/mpeg/mv_main.c
ico2/ito/mpeg/mv_readbuf.c
ico2/ito/mpeg/mv_strfile.c
ico2/ito/mpeg/mv_videodec.c
ico2/ito/mpeg/mv_vobuf.c
data:accessary
data:act-data-tbl
data:act-intrlist
data:act-mode-def
data:adpcmfile
data:attack-def
data:auto-escort
data:camera-set
data:exit-data
data:game-param
data:generator-sub-position
data:girl-warp-list
data:iconfile
data:idle-mot-def
data:init-func
data:look-target-data
data:motion-def
data:motion-ik-eff-def
data:motion-orient
data:motion-orient-def
data:motion-random-def
data:moviefile
data:node-fix-ofs
data:obj-action
data:obj-kind-data
data:obj-layout
data:obj-light
data:pair-motion
data:parallel-motion-tbl
data:param-escape-run
data:se-env
data:sedef
data:sefile
data:sekind
data:selist
data:shocklist
data:stage-all
data:stage-anim-model
data:stage-anim
data:stream-motion-def
data:tex-property
data:weapon-def
ico2/common/src/DObj.c align.rodata=16  # USA: weapon-def ends at 0x612618 and DObj.o's .rodata starts at 0x612620
ico2/common/src/StageManager.c
ico2/common/src/backStage.c
ico2/common/src/charFileManager.c
ico2/common/src/debug.c
ico2/common/src/debug_exception.c
ico2/common/src/debug_menu.c
ico2/common/src/gamesys.c
ico2/common/src/haveParentSimpleObj.c
ico2/common/src/icoMisc.c
ico2/common/src/kanban.c
ico2/common/src/kanbanBoot.c
ico2/common/src/layout_action.c
ico2/common/src/layout_texture.c
ico2/common/src/sceneManager.c
ico2/common/src/staffroll.c
data:staffroll_dat
ico2/sugipon/src/a_p_1.c
ico2/sugipon/src/act_a_p_1.c
ico2/sugipon/src/actressLight.c
ico2/sugipon/src/attackCheckBoundary.c
ico2/sugipon/src/box.c
ico2/sugipon/src/boy.c
ico2/sugipon/src/cage.c
ico2/sugipon/src/cageFix.c
ico2/sugipon/src/candle.c
ico2/sugipon/src/chandelier.c
ico2/sugipon/src/clipCollisionManager.c
ico2/sugipon/src/clothAnimation.c
ico2/sugipon/src/clothTest.c
ico2/sugipon/src/darkVolume.c
ico2/sugipon/src/effectTool.c
ico2/sugipon/src/enemy.c
ico2/sugipon/src/enemyParts.c
ico2/sugipon/src/flag.c  # present, no twin: its PAL .rodata is at 0x618DC8 after enemyParts.c's; three USA functions follow enemyParts.c's .text
ico2/sugipon/src/flyManager.c
ico2/sugipon/src/frameDependSequence.c
ico2/sugipon/src/girl.c
ico2/sugipon/src/girlForceField.c  # present, no twin: its PAL .rodata is at 0x618F08; USA functions of 324, 128 and 8 B after girl.c's .text, the first two its bodies with immediates masked
ico2/sugipon/src/handManager.c  # present, no twin: USA functions of 280, 668, 804 and 340 B follow girlForceField.c's, two of them its bodies with immediates masked
ico2/sugipon/src/item.c
ico2/sugipon/src/lineManager.c
ico2/sugipon/src/lodManager.c
ico2/sugipon/src/motionFileManager.c
ico2/sugipon/src/motionManager.c
ico2/sugipon/src/motionOrientManager.c
ico2/sugipon/src/motionViewer.c
ico2/sugipon/src/moveColTest.c
ico2/sugipon/src/multiBgaManager.c
ico2/sugipon/src/particleEffect.c
ico2/sugipon/src/particleLayout.c
ico2/sugipon/src/rope.c
ico2/sugipon/src/ropeFix.c
ico2/sugipon/src/rotObject.c
ico2/sugipon/src/spider.c
ico2/sugipon/src/spiderGroupManager.c
ico2/sugipon/src/stageMultiBgaManager.c
ico2/sugipon/src/staticBlur.c
ico2/sugipon/src/stormTest.c
ico2/sugipon/src/streamMotionManager.c
ico2/sugipon/src/sugiTree.c
ico2/sugipon/src/torch.c
ico2/sugipon/src/waySystemManager.c
ico2/sugipon/src/weapon.c
ico2/sugipon/src/windField.c
ico2/sugipon/src/windManager.c
ico2/sugipon/src/wireLetter.c
ico2/sugipon/src/worm.c
ico2/seki/src/Basic.c
ico2/seki/src/BgAnimation.c
ico2/seki/src/DisplayFont.c
ico2/seki/src/DisplayList.c
ico2/seki/src/DmaPacket.c
ico2/seki/src/EnemyInit.c
ico2/fumi/isys/gobj_cam_dl.c
ico2/fumi/src/act-env.c
ico2/fumi/src/act-way.c
ico2/fumi/src/act.c
ico2/fumi/src/act2.c
ico2/fumi/src/seMail.c
ico2/fumi/src/way_kidnap.c
ico2/fumi/src/way_llf.c
ico2/fumi/src/way_tool.c
ico2/script/src/deja.c
# ico2/script/src/e3.c .data starts 16-aligned at 0x4D09D0, 8 B after its predecessor; the object's section is 8-aligned
ico2/script/src/e3.c align.data=16
ico2/script/src/end.c
ico2/script/src/op.c
ico2/script/src/st00a.c
ico2/script/src/st01b.c
ico2/script/src/st02a.c
ico2/script/src/st03t.c
ico2/script/src/st04a.c
ico2/script/src/st04b.c
ico2/script/src/st04c.c
ico2/script/src/st04d.c
ico2/script/src/st04e.c  # present, no twin: five USA functions after st04d.c's .text take its sizes (actSt04eWater's body with immediates masked, then 48 and 88 B); its PAL .rodata, a HINT1_FINISH string, is not there
ico2/script/src/st04l.c
ico2/script/src/st04r.c
ico2/script/src/st05b.c
ico2/script/src/st05c.c
ico2/script/src/st05d.c
ico2/script/src/st05e.c  # present, no twin: after st05d.c's .text the USA ELF has actSt05eWater's body with immediates masked (0x225C60), the function before it of 320 B where PAL has actSt05eWaterStop (368 B)
ico2/script/src/st06a.c
ico2/script/src/st07a.c
ico2/script/src/st08a.c
ico2/script/src/st08b.c
ico2/script/src/st09a.c
ico2/script/src/st10l.c
ico2/script/src/st10r.c
ico2/script/src/st13a.c  # present, no twin: USA functions after st10r.c's .text take its sizes and order (228, 512, 156, 152, 120, 168, 48, 104, 48, 176, 176 B)
ico2/script/src/st13b.c
ico2/script/src/st13b2.c
ico2/script/src/st13c.c
ico2/script/src/st13d.c
ico2/script/src/st17a.c
ico2/script/src/st17b.c
ico2/script/src/st18a.c
ico2/script/src/st19a.c  # present, no twin: its PAL .rodata is at 0x61C310 between st18a.c's and st22a.c's
ico2/script/src/st20a.c
ico2/script/src/st22a.c
ico2/script/src/st24a.c  # present, no twin: its PAL .rodata is at 0x61C340 and its .lit4 at 0x631734, after st22a.c's
ico2/script/src/st47a.c
ico2/script/src/st99a.c
ico2/script/src/stageSEProc.c
ico2/omori/src/access.c
ico2/omori/src/lws_kyomi.c  # moved from after hand-camera.c: its twin SetParamKyomiGObj is in the USA .text between access.c's and objact.c's
ico2/omori/src/objact.c
ico2/ito/mpeg/mv_audiodec.c
ico2/ito/mpeg/mv_disp.c
ico2/ito/mpeg/mv_sub.c
ico2/ito/mpeg/mv_vibuf.c
ico2/common/src/GobjProc.c
data:blend-motion-def
ico2/sugipon/src/enemyKind.c
data:enemy-model-grp
data:enemy-model-tbl
data:enemy-random-def
data:enemy-random-variation-def
data:layout-cloth-def
data:motion-eff-condition-def
data:motion-eff-def
data:motion-eff-random-def
data:motion-limit-def
data:motion-se-condition-def
data:motion-se-random-def
data:obj-trigger-def
data:obj-trigger
data:parallel-motion-orient
data:particle-effect
data:spider-def
data:texture-path  # .rodata between spider-def and way-group here (config/data_members.ntsc.txt); PAL links it in .data after texture-layout
data:way-group
ico2/common/src/PObj.c
data:unmapped_00533FC0  # first in its .data run here, before item-kind-def (data_members.ntsc.txt)
data:item-kind-def
data:mirror-motion-def
data:model-path
data:prog-se-link
data:texture-layout
data:way-point
data:weapon-fumble-def
ico2/fumi/src/vobj.c
sce/libgraph/graph001.c
sce/libgraph/graph002.c
sce/libgraph/graph003.c
sce/libgraph/graph004.c
sce/libgraph/graph006.c
sce/libgraph/graph008.c
sce/libgraph/graph009.c
sce/libgraph/graph010.c
sce/libgraph/graph011.c
sce/libgraph/graph012.c
sce/libgraph/graph013.c
sce/libgraph/graph014.c
sce/libgraph/graph015.c
sce/libgraph/graph016.c
sce/libgraph/graph017.c
sce/libgraph/graph018.c
sce/libgraph/graph020.c
sce/libgraph/graph021.c
sce/libgraph/graph029.c
sce/libgraph/graph005.c
sce/libgraph/graph007.c
sce/libvu0/libvu0.c
sce/libdma/libdma.c
sce/libpkt/vifpk025.c
sce/libpkt/vifpk026.c
sce/libpkt/vifpk027.c
sce/libpkt/vifpk030.c
sce/libpkt/vifpk036.c
sce/libpkt/vifpk039.c
sce/libpkt/vifpk040.c
sce/libpkt/vifpk041.c
sce/libpkt/vifpk042.c
sce/libpkt/vifpk044.c
sce/libpkt/vifpk053.c
sce/libkernl/glue.c
sce/libkernl/tty.c
sce/libkernl/sifrpc.c
sce/libkernl/filestub.c
sce/libkernl/iopheap.c
sce/libkernl/eeloadfile.c
sce/libkernl/iopreset.c
sce/libkernl/tlbfunc.c
sce/libkernl/tlbtrap.s
sce/libkernl/sifcmd.c
sce/libcdvd/cdvd000.c
sce/libcdvd/cdvd005.c
sce/libcdvd/cdvd006.c
sce/libcdvd/cdvd014.c
sce/libcdvd/cdvd015.c
sce/libcdvd/libcdvd_267388.c
sce/libcdvd/cdvd047.c
sce/libpad/libpad.c
sce/libmc/libmc.c
sce/libmpeg/pack.c
sce/libmpeg/mpeg.c
sce/libmpeg/init.c
sce/libmpeg/defhandler.c
sce/libmpeg/var.c
sce/libmpeg/mpc.c
sce/libmpeg/csc.c
sce/libmpeg/bit.c
sce/libipu/libipu.c
sce/libipu/ipuinit.c
sce/libsndn2/sound.c
sce/libm/math/sf_sin.c
sce/libm/math/wf_acos.c
sce/libm/math/wf_asin.c
sce/libm/math/wf_atan2.c
sce/libm/math/wf_fmod.c
sce/libm/math/ef_acos.c
sce/libm/math/ef_asin.c
sce/libm/math/ef_atan2.c
sce/libm/math/ef_fmod.c
sce/libm/math/ef_rem_pio2.c
sce/libm/math/ef_sqrt.c
sce/libm/math/kf_cos.c
sce/libm/math/kf_rem_pio2.c
sce/libm/math/kf_sin.c
sce/libm/common/s_lib_ver.c
sce/libm/common/s_matherr.c
sce/libm/math/sf_atan.c
sce/libm/math/sf_fabs.c
sce/libm/math/sf_floor.c
sce/libm/math/sf_isnan.c
sce/libm/common/sf_scalbn.c
sce/libm/common/sf_copysign.c
sce/libgcc/__main.c
sce/libgcc/_ctors.c
sce/libgcc/_divdi3.c
sce/libgcc/_fixunsdfdi.c
sce/libgcc/_floatdidf.c
sce/libgcc/_moddi3.c
sce/libgcc/_muldi3.c
sce/libgcc/_udivdi3.c
sce/libgcc/_umoddi3.c
sce/libgcc/dp-bit.c
sce/libgcc/fp-bit.c
sce/libc/stdlib/assert.c
sce/libc/stdlib/atoi.c
sce/libc/ctype/ctype_.c
sce/libc/errno/errno.c
sce/libc/stdio/fiprintf.c
sce/libc/reent/impure.c
sce/libc/machine/r5900/memcmp.s
sce/libc/machine/r5900/memcpy.s
sce/libc/machine/r5900/memset.s
sce/libc/stdio/printf.c
sce/libc/stdlib/qsort.c
sce/libc/stdlib/rand.c
sce/libc/stdio/sprintf.c
sce/libc/stdio/sscanf.c
sce/libc/machine/r5900/strcat.s
sce/libc/machine/r5900/strcmp.s
sce/libc/machine/r5900/strcpy.s
sce/libc/machine/r5900/strlen.s
sce/libc/machine/r5900/strncmp.s
sce/libc/machine/r5900/strncpy.s
sce/libc/string/strrchr.c
sce/libc/string/strstr.c
sce/libc/string/strtok.c
sce/libc/string/strtok_r.c
sce/libc/stdlib/strtol.c
sce/libc/stdio/vfiprintf.c
sce/libc/stdio/vfprintf.c
sce/libc/stdio/vfscanf.c
sce/libc/stdio/vsprintf.c
sce/libc/stdio/wsetup.c
sce/libc/stdlib/abort.c
sce/libc/stdlib/atof.c
sce/libc/stdlib/dtoa.c
sce/libc/stdio/fflush.c
sce/libc/stdio/findfp.c
sce/libc/stdio/fread.c
sce/libc/stdlib/freer.c
sce/libc/stdio/fvwrite.c
sce/libc/stdio/fwalk.c
sce/libc/locale/locale.c
sce/libc/stdio/makebuf.c
sce/libc/stdlib/mallocr.c
sce/libc/stdlib/mbtowc_r.c
sce/libc/machine/r5900/memchr.s
sce/libc/machine/r5900/memmove.s
sce/libc/stdlib/mlock.c
sce/libc/stdlib/mprec.c
sce/libc/stdio/refill.c
sce/libc/s_isinf.c
sce/libc/s_isnan.c
sce/libc/reent/sbrkr.c
sce/libc/signal/signal.c
sce/libc/reent/signalr.c
sce/libc/stdio/stdio.c
sce/libc/stdlib/strtod.c
sce/libc/stdlib/strtoul.c
sce/libc/stdio/ungetc.c
sce/libc/reent/writer.c
sce/libc/stdlib/callocr.c
sce/libc/reent/closer.c
sce/libc/reent/fstatr.c
sce/libc/reent/lseekr.c
sce/libc/reent/readr.c
sce/libc/stdlib/reallocr.c
sce/libc/s_infconst.c
sce/libkernl/cache.c
sce/libgcc/_fixdfdi.c
ico2/vusrc/cluster.dsm  overlay-fill=110
ico2/vusrc/mesh.dsm  overlay-fill=110
ico2/vusrc/normal_c.dsm  overlay-fill=110
ico2/vusrc/normal_l.dsm  overlay-fill=110
ico2/vusrc/particle.dsm  overlay-fill=110
