As far as I know, shareholders usually rank behind note holders in the event of receiving proceeds from the liquidation of a company. So, creditors need to be fully paid before shareholders can be paid.
I am not 100% sure about the above. Correct me if I am wrong.