SEGEDIT(1)
β¨ NAME β¨
okay so welcome to the SEGEDIT(1) page from the General Commands Manual, bestie π
β this one is all about segedit, the girlie who can extract and replace sections from object files β¨
π SYNOPSIS π
segedit input_file [-extract seg_name sect_name data_file] ...
segedit input_file [-replace seg_name sect_name data_file] ... -output
output_file
π DESCRIPTION π
so segedit extracts or replaces named sections from input_file, no cap π«Ά
When extracting sections, segedit will write the contents of each requested section into data_file. When replacing sections, segedit will write a new output_file formed from the input_file and the requested replacement section content from data_file. The segment and section names are the same as those given to ld(1) with the -sectcreate option. The segment and section names of an object file can be examined with the -l option to otool(1) π
Only sections in segments that have no relocation to or from them (i.e., segments marked with the SG_NORELOC flag) can be replaced but all sections can be extracted. That's the vibe check for replacing, fr fr π
π οΈ the options to segedit(1) π οΈ
-extract seg_name sect_name data_fileβ extracts each section specified by the segment and section names and places the contents in the specifieddata_file. If the output file is-the section contents will be written to the standard output β¨-replace seg_name sect_name data_fileβ replaces each section specified by the segment and section names and takes the new section content from the specifieddata_file. The-output output_fileoption must also be specified. The resulting size of the section will be rounded to a multiple of 4 bytes and padded with zero bytes if necessary π-output output_fileβ specifies the new file to create when replacing sections π
π₯ SEE ALSO π₯
ld(1), otool(1), lipo(1) β go read those too, iykyk π
π LIMITATIONS π
Only Mach-O format files that are laid out in a contiguous address space and with their segments in increasing address order can have their segments replaced by this program. This layout is what ld(1) produces by default. No cap, that layout matters π«Ά
Only sections in segments that have no relocation to or from them (i.e., segments marked with the SG_NORELOC flag) can be replaced. Again: replacement only, extraction is still available for all sections π
segedit will not extract or replace sections from universal files. If necessary, use lipo(1) to extract the desired Mach-O files from a universal file before running segedit π
that's the tea, bestie π β this page is from Apple, Inc., dated June 25, 2018, and it's SEGEDIT(1) πβ¨
π¦ where this page comes from
- nixpkgs unstable: cctools 1010.6
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms