tool-zobjcopy

Edits z80asm object and library files to rename sections, symbols, and adjust ORG or ALIGN values.

1.1k|206|Updated Mar 16, 2016
One-click install
npx skills add https://github.com/z88dk/z88dk --skill tool-zobjcopy-z88dk
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tool-zobjcopy
Source: https://github.com/z88dk/z88dk/tree/main/.agents/skills/tool-zobjcopy
Command: npx skills add https://github.com/z88dk/z88dk --skill tool-zobjcopy-z88dk

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? When working with z88dk's z80asm assembler, developers often need to inspect or modify compiled object and library files without recompiling from source. This Skill provides the reference for using z88dk-zobjcopy to perform object file surgery such as renaming sections and symbols, changing symbol locality, and adjusting ORG and ALIGN addresses. ## Core Features & Use Cases - Object File Inspection: Dump the contents of z80asm object and library files with -l, optionally hiding local symbols, expressions, or code dumps. - Section and Symbol Renaming: Rename sections via regex (-s old-regexp=new-name), rename global and extern symbols (-y), or add prefixes to matching symbols (-p). - Linkage and Layout Control: Make symbols local or global (-L / -G), change a section's ORG address (-O), adjust ALIGN values (-A), and set the filler byte for alignment (-F). - Use Case: You are linking third-party z80 libraries and hit a symbol name collision. Use zobjcopy to rename the conflicting symbols or make them local, then relink without touching the original source code. ## Quick Start Ask the AI to list the contents of a z80asm object file or rename a conflicting symbol in it using z88dk-zobjcopy.

Frequently Asked Questions about tool-zobjcopy

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I rename a symbol in a z80asm object file?

Use z88dk-zobjcopy with the -y flag in the form old-name=new-name to rename global and extern symbols. For bulk changes, -p adds a prefix to all symbols matching a regular expression.

How do I inspect the contents of a z88dk object file?

Run z88dk-zobjcopy with the -l or --list flag to dump the file contents. You can filter the output with --hide-local, --hide-expr, or --hide-code to suppress local symbols, expressions, or code dumps.

Can zobjcopy fix symbol collisions when linking z80 libraries?

Yes, zobjcopy resolves symbol collisions by renaming conflicting symbols with -y, prefixing them with -p, or making them local with -L so they no longer clash at link time. This avoids recompiling the original source.

How do I change the ORG address of a section in an object file?

Use the -O flag with the syntax section,nn or section,0xhh to set a new ORG address for one section. Similarly, -A changes the ALIGN value and -F sets the filler byte used for alignment padding.

What is the difference between zobjcopy and z80nm in z88dk?

z80nm only lists symbols in object and library files, while zobjcopy both lists and modifies them. Use zobjcopy when you need to rename sections or symbols, change locality, or adjust ORG and ALIGN values.