@@ -475,6 +475,12 @@ void ScriptParser::readOutputFormat() {
475
475
consume (" )" );
476
476
}
477
477
s = config->bfdname ;
478
+
479
+ if (s == " binary" ) {
480
+ config->oFormatBinary = true ;
481
+ return ;
482
+ }
483
+
478
484
if (s.consume_back (" -freebsd" ))
479
485
config->osabi = ELFOSABI_FREEBSD;
480
486
@@ -837,8 +843,7 @@ Expr ScriptParser::readAssert() {
837
843
};
838
844
}
839
845
840
- #define ECase (X ) \
841
- { #X, X }
846
+ #define ECase (X ) {#X, X}
842
847
constexpr std::pair<const char *, unsigned > typeMap[] = {
843
848
ECase (SHT_PROGBITS), ECase (SHT_NOTE), ECase (SHT_NOBITS),
844
849
ECase (SHT_INIT_ARRAY), ECase (SHT_FINI_ARRAY), ECase (SHT_PREINIT_ARRAY),
@@ -850,7 +855,8 @@ constexpr std::pair<const char *, unsigned> typeMap[] = {
850
855
// "(TYPE=<value>)".
851
856
// Tok1 and Tok2 are next 2 tokens peeked. See comment for
852
857
// readSectionAddressType below.
853
- bool ScriptParser::readSectionDirective (OutputSection *cmd, StringRef tok1, StringRef tok2) {
858
+ bool ScriptParser::readSectionDirective (OutputSection *cmd, StringRef tok1,
859
+ StringRef tok2) {
854
860
if (tok1 != " (" )
855
861
return false ;
856
862
if (tok2 != " NOLOAD" && tok2 != " COPY" && tok2 != " INFO" &&
@@ -1349,10 +1355,10 @@ static std::optional<uint64_t> parseFlag(StringRef tok) {
1349
1355
// Example: SHF_EXECINSTR & !SHF_WRITE means with flag SHF_EXECINSTR and
1350
1356
// without flag SHF_WRITE.
1351
1357
std::pair<uint64_t , uint64_t > ScriptParser::readInputSectionFlags () {
1352
- uint64_t withFlags = 0 ;
1353
- uint64_t withoutFlags = 0 ;
1354
- expect (" (" );
1355
- while (!errorCount ()) {
1358
+ uint64_t withFlags = 0 ;
1359
+ uint64_t withoutFlags = 0 ;
1360
+ expect (" (" );
1361
+ while (!errorCount ()) {
1356
1362
StringRef tok = unquote (next ());
1357
1363
bool without = tok.consume_front (" !" );
1358
1364
if (std::optional<uint64_t > flag = parseFlag (tok)) {
@@ -1490,7 +1496,8 @@ Expr ScriptParser::readPrimary() {
1490
1496
readExpr ();
1491
1497
expect (" )" );
1492
1498
script->seenRelroEnd = true ;
1493
- return [=] { return alignToPowerOf2 (script->getDot (), config->maxPageSize ); };
1499
+ return
1500
+ [=] { return alignToPowerOf2 (script->getDot (), config->maxPageSize ); };
1494
1501
}
1495
1502
if (tok == " DEFINED" ) {
1496
1503
StringRef name = unquote (readParenLiteral ());
0 commit comments