The seventh aliyah describes the laws of a non-Jew who becomes rich. Rashi interprets: by clinging to you. Also here is the law of a Jew becoming poor which Rashi interprets: by clinging to the non-Jew and learning from his doings. The aliyah continues: the Jew sells himself to the non-Jew, his relatives may redeem the Jew and the Jubilee year releases him.
The Torah then mentions the prohibition of not making an idol. Rashi says this is mentioned here, so that a Jew who is a bondsman of a non-Jew shouldn't forget who he is, and despite who his master is, he still must keep the Sabbath, not worship idols, etc.