| Issue |
87891
|
| Summary |
Linker script `OUTPUT_FORMAT` command does not support `binary` option
|
| Labels |
new issue
|
| Assignees |
|
| Reporter |
fumoboy007
|
# Background
The `OUTPUT_FORMAT` linker script [command](https://sourceware.org/binutils/docs/ld/Format-Commands.html) is equivalent to the `--oformat` command-line option.
[D23769](https://reviews.llvm.org/D23769) implemented support for `--oformat binary`, which is used for embedded devices that do not support standard executable container formats like ELF.
# Problem
It appears that D23769 only updated the command-line driver and did not update the linker script [parser implementation](https://github.com/llvm/llvm-project/blob/b88a1dd6c75754ace4abe18c8ea16a019f7b5529/lld/ELF/ScriptParser.cpp#L457-L487). So the linker script command `OUTPUT_FORMAT(binary)` is currently unrecognized.
# Proposed Solution
As far as I can tell, the change to the parser implementation should be trivial: check for the special value `"binary"` and set `config->oFormatBinary = true`.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs