[PATCH 2/3] ELF: reliably invoke md_elf_section_change_hook()

Jan Beulich jbeulich@suse.com
Fri Dec 8 12:25:53 GMT 2023


On 08.12.2023 13:07, Nick Clifton wrote:
>> Considering that no caller outside of obj-elf.c cares about the existing
>> "push" and the new "new_subsection" arguments, an alternative might be
>> to drop the "push" one in a prereq patch, thus eliminating the need for
>> this one to touch various targets. Thoughts anyone?
> 
> I like the idea of a simpler patch that does not involve updating any of
> the target code.

Ftaod, the same targets will need updating nevertheless, just that it's
not going to happen in this (functional) change.

>  So if it works then I would suggest that you go for it.

I don't see why it shouldn't, so I'll see about doing the split.

> One other, very minor point:
> 
>> +  subsegT new_subsection = 0;
> 
> There are a lot of places where we use 0 to indicate no-subsection.  I
> wonder if the code would be easier to read if we had a constant defined
> in subseg.h and used that instead.  eg:
> 
>       subsegT new_subsection = NO_SUBSEG;
> or:
>       subseg_set (comment_section, NO_SUBSEG);
> 
> Just a thought.

I probably could be convinced, but I don't like this. First and foremost
it's not really "no subsection", it really is just the first of potentially
many (yet typically the only one).

Jan


More information about the Binutils mailing list