lib: merge internal prefix tables