A company is not your friend, or your enemy. It's a machine. See it as such, use it as such.
A particular person above you in the management chain may actually be your friend. It does not mean that that person would be able to protect you from a layoff; that could be a conflict of interest. That person might give you an earlier warning so that you could start looking around ahead of time. That person could give you a glowing review and references for prospective employers. That person might introduce you to someone who might be interested in hiring you. But that person operates the machine, and plays by the rules of the machine, to which you have agreed when you have signed your offer.
Build good relationships with coworkers; this can be helpful, and is just more pleasant. But don't try to build a relationship with a company; you can't.
A particular person above you in the management chain may actually be your friend. It does not mean that that person would be able to protect you from a layoff; that could be a conflict of interest. That person might give you an earlier warning so that you could start looking around ahead of time. That person could give you a glowing review and references for prospective employers. That person might introduce you to someone who might be interested in hiring you. But that person operates the machine, and plays by the rules of the machine, to which you have agreed when you have signed your offer.
Build good relationships with coworkers; this can be helpful, and is just more pleasant. But don't try to build a relationship with a company; you can't.