obj: move shared code to obj-common