Commit 3fd4fa5
committed
create-diff-object: Fix ordering of __patchable_function_entries
Old linkers don't support mixing ordered and unordered sections. This
was fixed in binutils, see discussion in [1]. But without this fix,
kpatch-build fails with an error like:
| ld.bfd: __patchable_function_entries has both ordered
| [`__patchable_function_entries' in /builddir/.kpatch/tmp/patch/output.o]
| and unordered [`__patchable_function_entries' in
| /builddir/.kpatch/tmp/patch/patch-hook.o] sections
| ld.bfd: final link failed: bad value
Fix this by only setting SHF_LINK_ORDER in the output object if the
patched object also has this flag set.
Signed-off-by: Puranjay Mohan <pjy@amazon.com>1 parent e390415 commit 3fd4fa5
3 files changed
+25
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1992 | 1992 | | |
1993 | 1993 | | |
1994 | 1994 | | |
| 1995 | + | |
| 1996 | + | |
1995 | 1997 | | |
1996 | 1998 | | |
1997 | 1999 | | |
| |||
3729 | 3731 | | |
3730 | 3732 | | |
3731 | 3733 | | |
3732 | | - | |
| 3734 | + | |
3733 | 3735 | | |
3734 | 3736 | | |
3735 | 3737 | | |
| |||
3745 | 3747 | | |
3746 | 3748 | | |
3747 | 3749 | | |
3748 | | - | |
| 3750 | + | |
3749 | 3751 | | |
3750 | 3752 | | |
3751 | 3753 | | |
| |||
3858 | 3860 | | |
3859 | 3861 | | |
3860 | 3862 | | |
3861 | | - | |
| 3863 | + | |
| 3864 | + | |
| 3865 | + | |
| 3866 | + | |
| 3867 | + | |
| 3868 | + | |
| 3869 | + | |
| 3870 | + | |
3862 | 3871 | | |
3863 | 3872 | | |
3864 | 3873 | | |
| |||
4158 | 4167 | | |
4159 | 4168 | | |
4160 | 4169 | | |
4161 | | - | |
4162 | 4170 | | |
4163 | 4171 | | |
4164 | 4172 | | |
| |||
4184 | 4192 | | |
4185 | 4193 | | |
4186 | 4194 | | |
4187 | | - | |
4188 | | - | |
4189 | 4195 | | |
4190 | 4196 | | |
4191 | 4197 | | |
| |||
4266 | 4272 | | |
4267 | 4273 | | |
4268 | 4274 | | |
4269 | | - | |
| 4275 | + | |
4270 | 4276 | | |
4271 | 4277 | | |
4272 | 4278 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
559 | 559 | | |
560 | 560 | | |
561 | 561 | | |
| 562 | + | |
562 | 563 | | |
563 | 564 | | |
564 | 565 | | |
| |||
614 | 615 | | |
615 | 616 | | |
616 | 617 | | |
617 | | - | |
618 | | - | |
| 618 | + | |
| 619 | + | |
| 620 | + | |
619 | 621 | | |
| 622 | + | |
| 623 | + | |
| 624 | + | |
| 625 | + | |
| 626 | + | |
| 627 | + | |
| 628 | + | |
620 | 629 | | |
621 | 630 | | |
622 | 631 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
127 | 127 | | |
128 | 128 | | |
129 | 129 | | |
| 130 | + | |
130 | 131 | | |
131 | 132 | | |
132 | 133 | | |
| |||
0 commit comments