Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 1 | |
| 2 | This patch is from ubuntu: |
| 3 | * objcopy-absolute.diff (update): Remove .note, .comment, and |
| 4 | .note.gnu.build-id sections from images (LP: #444703). |
| 5 | |
| 6 | Upstream-Status: Inappropriate [no longer maintained] |
| 7 | |
| 8 | Index: b/acinclude.m4 |
| 9 | =================================================================== |
| 10 | --- a/acinclude.m4 |
| 11 | +++ b/acinclude.m4 |
| 12 | @@ -61,7 +61,7 @@ |
| 13 | else |
| 14 | AC_MSG_ERROR([${CC-cc} cannot link at address $link_addr]) |
| 15 | fi |
| 16 | - if AC_TRY_COMMAND([${OBJCOPY-objcopy} -O binary conftest.exec conftest]); then : |
| 17 | + if AC_TRY_COMMAND([${OBJCOPY-objcopy} --only-section=.text -O binary conftest.exec conftest]); then : |
| 18 | else |
| 19 | AC_MSG_ERROR([${OBJCOPY-objcopy} cannot create binary files]) |
| 20 | fi |
| 21 | Index: b/stage1/Makefile.am |
| 22 | =================================================================== |
| 23 | --- a/stage1/Makefile.am |
| 24 | +++ b/stage1/Makefile.am |
| 25 | @@ -12,4 +12,4 @@ |
| 26 | |
| 27 | SUFFIXES = .exec |
| 28 | .exec: |
| 29 | - $(OBJCOPY) -O binary $< $@ |
| 30 | + $(OBJCOPY) -O binary -R .note -R .comment -R .note.gnu.build-id $< $@ |
| 31 | Index: b/stage2/Makefile.am |
| 32 | =================================================================== |
| 33 | --- a/stage2/Makefile.am |
| 34 | +++ b/stage2/Makefile.am |
| 35 | @@ -293,4 +293,4 @@ |
| 36 | # General rule for making a raw binary. |
| 37 | SUFFIXES = .exec |
| 38 | .exec: |
| 39 | - $(OBJCOPY) -O binary $< $@ |
| 40 | + $(OBJCOPY) -O binary -R .note -R .comment -R .note.gnu.build-id $< $@ |