33 Commits

Author SHA1 Message Date
Andrew LeFevre 2b8504217e Support parsing the 'importmap' directive in an importcfg file.
Also change Parse to take in a function instead of a map to give the caller additional flexibility.

Fixes #13 and #17.
2020-11-08 13:56:08 -05:00
Andrew LeFevre cc437dcdb1 fix #14 by exporting ArchiveMember.IsDataObj to allow users to create data archive members themselves 2020-10-21 16:28:24 -04:00
Andrew LeFevre 6349fcc2a6 expose SymKind values 2020-09-02 13:35:56 -04:00
Andrew LeFevre 65b108cdac properly close file in Write... smh 2020-09-02 13:28:09 -04:00
Andrew LeFevre 11235b0672 fixed not reading cgo objects correctly 2020-08-28 09:22:13 -04:00
Andrew LeFevre 1a6afe261a fix bug when handling url-encoded import paths, improve error messages 2020-08-27 15:29:48 -04:00
Andrew LeFevre 6c635acc3f add comments, make Write a method of Package 2020-08-27 08:22:00 -04:00
Andrew LeFevre 2da520b91f removed symbol sorting code, not neccesary and speeds things up a bit 2020-08-26 10:32:31 -04:00
Andrew LeFevre d63df83dee WIP on getting reading/writing working for archives with multiple objects in them/ASM objects 2020-08-25 11:11:10 -04:00
Andrew LeFevre 6444916c14 improve importcfg parsing, mostly copied code from the Go linker 2020-08-21 12:18:15 -04:00
Andrew LeFevre affce5855a initial work on allowing Parse to accept a linker's importcfg as an optimization to avoid 'go list' calls 2020-08-20 17:56:06 -04:00
Andrew LeFevre d783f9a5c6 parse archive headers, update size field of archive headers to support editing object files 2020-08-20 14:45:42 -04:00
Andrew LeFevre e070d52fc6 fix genFuncInfoSyms, now works properly 2020-08-20 10:03:04 -04:00
Andrew LeFevre 06488d6254 tweak string table detection logic (correct some offsets), simplified exported funcs a bit. Parsing and writing an objfile from github.com/lu4p/binclude works now!! 2020-08-19 15:05:44 -04:00
Andrew LeFevre 736b43b3be properly resolve import's object files using 'go list', find init sym correctly by using the package name, improve symbol string table searching logic 2020-08-19 11:18:24 -04:00
Andrew LeFevre beeb73cc56 added 2 more test cases 2020-08-18 17:17:34 -04:00
Andrew LeFevre ccfb1f895a improve logic for finding inline function names for stdlib functions and logic for sorting text symbols. Added test case 2020-08-18 16:32:03 -04:00
Andrew LeFevre b2ee1aae9e fixed init task's string ordering, added test case 2020-08-18 09:15:14 -04:00
Andrew LeFevre 342a092dea remove unused field in textSym 2020-08-18 08:06:21 -04:00
Andrew LeFevre fa7b4300b7 fix inline function symbol name resolution, add test case 2020-08-17 17:42:44 -04:00
Andrew LeFevre 56e5f34257 fix bug where symbols were not sorted correctly, added new test case 2020-08-17 15:20:58 -04:00
Andrew LeFevre 2e709d0be8 make parsing detirministic, overhaul test 2020-08-12 17:27:17 -04:00
Andrew LeFevre e2db12419b reordered string printing so the string table is identical at least for a simple hello world program 2020-08-12 16:10:24 -04:00
Andrew LeFevre f01fb25ba8 fix genFuncInfoSyms, resolve inlined call function names 2020-08-12 16:04:37 -04:00
Andrew LeFevre ea61e19a03 add more strings to string table, still missing a few 2020-08-09 20:18:49 -04:00
Andrew LeFevre e62e341d65 added comments that point to the origin of much of the code 2020-08-09 15:46:45 -04:00
Andrew LeFevre 7c908753d0 fix silly copy-pasta error, now an object file can be parsed -> written -> parsed without errors. But the parsed struct is still not identical. 2020-08-09 15:43:34 -04:00
Andrew LeFevre 559d8c28be everything is written, currently only the object header, imports, packages and dwarf files are parsed correctly from a written obj file. Also added test 2020-08-09 13:51:54 -04:00
Andrew LeFevre 52974464c4 Symbol References writing 2020-08-07 14:04:38 -04:00
Andrew LeFevre 33ebce06fd everything is written except for Symbol References 2020-08-07 13:47:38 -04:00
Andrew LeFevre d93ba3701d import and symbol writing working 2020-08-07 11:47:11 -04:00
Andrew LeFevre cd1ad3dc4b symbol definitions/references are now stored in separate slices mirroring how they are stored in object files 2020-08-06 12:20:00 -04:00
Andrew LeFevre 8dbb8aeb30 initial work on moving code from cmd/internal/goobj2 to read new Go object files 2020-07-24 13:27:57 -04:00