Deuteronomy 21:16

CLV(i) 16 then it will come to be in the day when he gives allotments to his sons of that which is his, that he should not be able to treat as firstborn the son of the loved in preference to the son of the disliked, who is the firstborn.