[PATCH] D28561: [ELF] - Move the addition of synthetics from addPredefinedSections()

George Rimar via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 12 07:32:07 PST 2017


>> -# .shstrtab from the input object file is discarded.
>> +# .shstrtab is discarded.
>>  # RUN: echo "SECTIONS { \
>>  # RUN:          /DISCARD/ : { *(.shstrtab) } }" > %t.script
>
>This is a really odd script. What does gold and bfd do? Have you found
>something like that in the wild? I am inclined to just error in cases
>like this.

Honestly I did not check what gold/bfd do. I can check if you want.
Specification says: "If the file has no section name string table, this member holds the value SHN_UNDEF" (https://docs.oracle.com/cd/E23824_01/html/819-0690/chapter6-43405.html),
and this testcase was failing because of readobj error for me.

Since readelf works fine, there was a choice either to remove that testcase or fix.
I supposed that it is probably cleaner to support it than to report special errors, since fix looks conformant to specification and short.

Actually I am ok to error out this instead, but something like
if (isDiscarded(".shstrtab"))
  report_error()
is not shorter or simpler it seems.

George.




More information about the llvm-commits mailing list