fix code and data segments