Regulatory differences between stocks and bonds If you buy stocks of a company you are buying a share in that business. 
If you buy bonds from the same company you are essentially loaning them money for future payment.

I am guessing (correct me if I am wrong!) that if you buy a bond the terms of repayment have to be very concrete, i.e. you get 2 dollars next year and 10 after that. Otherwise they could tag the repayment to the stock price and what you would have is a bond that behaves like a stock with automated dividends.

My question: 
What body of law governs what you can and cannot promise in a bond contract and what agency is overseeing this? (Corporate law and the SEC?) I am most interested in the US setting, but info about other countries is also welcome.

A secondary question is what big practical differences between stocks and bonds the regulation causes. (The common economics/finance wisdom is that stocks have higher yields but bigger 'risk'. I am more interested in practical differences that lie in the mechanisms, such as bond owners having precedence in case of bankruptcy.)
Bonds and stocks, and in general all securities related to a firm, are regulated by the SEC in the US. Some other financial instruments are regulated by the CFTC (mainly commodities and derivatives, though some of the latter are regulated by the SEC)
Stocks
Stocks are a share in the firm. Meaning they are actually ownership securities. Hoilding a stock entitle their holder to earn a part of the earnings of the firm - the dividends, and to have a say in the strategy of the firm, through a vote at the Annual General Meeting.
Different kinds of stocks can be found: The difference usually lies in the number of votes that each share carries, or in their seniority in case of bankruptcy (preferred shares get paid before common shares)
A good example is Alphabet's (Google's) shares:

A shares, which have one vote each (NASDAQ:GOOGL)
B shares, which have 1 vote each (not publicly traded)
C shares, which are capital-only (no votes attached) (NASDAQ:GOOG)

This allows the founders to maintain ownership of the company while raising additional funds. As you can guess, Sergei Brin, Larry Page and then Eric Schmidt own a minority of the total stock, but secure more than 70% of the voting right through their holding of B shares.
Bonds
Bonds are debt securities: they do not represent ownership but they represent a claim. In opposite to stocks, there are plenty of different types of bonds. There is a huge diversity, and the main characteristics that can change are the following:

Maturity (When do you get paid back the nominal amount): it can go to a few months to 30 years or more (the UK still has outstanding debt with no maturity)
Interest rate (How much do you get, and at which frequency?): It can go from zero to any other amount. It can be fixed, or variable, for example indexed on inflation.
The seniority (who gets paid first in case of bankruptcy)
The collateral (Are you entitled to receive a particular asset in case of default?)
Other options, such as convertibility (some bonds can be converted to shares, for example if the firm defaults on these bonds, or if the bondholders asks for the conversion.)

To put everything together, what happens in case of a bankruptcy is that direct creditors are paid first: the government (taxes), the employees, the suppliers, etc. Then, the other creditors are paid, if there is anything less, in order of seniority: either because some debt are embedded with particular seniority level, such as First Lien Debt, or in order of maturity (short term debt first). Some debt have a collateral, which the holders of the debt have a claim on in case of default. For example, ABS and MBS are 'guaranteed' by assets which the lender will get if they aren't paid. The governments can also extend guarantees on private firms lending.
This explains why the two types of security have different risk profile.
For a firm, the rules/regulations on each type of security have a very deep impact. Namely, it is less costly to raise debt: first, debt costs less (interest rates are typically lower than equity yield), and also because the interest rates are tax-deductible. This can cause problems as it incite firms to take on more debt than they otherwise would, as underlined by this article from The Economist.