[PATCH] D41234: [ELF] Fix placement of a sentinel entry in the .ARM.exidx section.

Rafael Avila de Espindola via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 14 07:35:17 PST 2017


Igor Kudrin via Phabricator <reviews at reviews.llvm.org> writes:

> +    // ARM ABI requires .ARM.exidx to be terminated by some piece of data.
> +    // We have the terminater synthetic section class. Add that at the end.
> +    if (!Config->Relocatable && Sec->Name == ".ARM.exidx") {

You could have stopped earlier if this was relocatable, no?

Why do you need to check the name?

>    // Location in the output buffer.
>    uint8_t *Loc = nullptr;
> Index: ELF/OutputSections.cpp
> ===================================================================
> --- ELF/OutputSections.cpp
> +++ ELF/OutputSections.cpp
> @@ -88,7 +88,11 @@
>           Type == SHT_NOTE;
>  }
>  
> -void OutputSection::addSection(InputSection *IS) {
> +// Add IS to the output section.
> +// If Hint is provided, it will be used to keep IS.
> +// Overwise, a new InputSectionDescription will be added.

Now that the last section is passed to the sentinel constructor, why do
you care which ISD is used?

Cheers,
Rafael


More information about the llvm-commits mailing list