* gas: set_symtab()'s setting of BSF_KEEP
@ 2022-05-04 8:54 Jan Beulich
2022-05-04 9:36 ` Alan Modra
0 siblings, 1 reply; 2+ messages in thread
From: Jan Beulich @ 2022-05-04 8:54 UTC (permalink / raw)
To: Alan Modra; +Cc: Binutils
Alan,
while looking into how to address an Arm64 regression I ended up
coming across this code, originating from commit 76d129399558. The
first thing that puzzled me was the != for checking BSF_SECTION_SYM.
Shouldn't this be a check of just the single bit? The other thing
looking slightly odd was the mix of || and !( && ). After
transforming the whole thing to
if (!(asympp[i]->flags & BSF_SECTION_SYM)
|| !bfd_is_const_section (asympp[i]->section)
|| asympp[i]->section->symbol != asympp[i])
asympp[i]->flags |= BSF_KEEP;
it then occurred to me that the last part of the condition ought
to be redundant with the combination of the first two. Or is there
a way for *ABS* to have more than a single symbol having
BSF_SECTION_SYM set on it?
Thanks for any further insight,
Jan
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: gas: set_symtab()'s setting of BSF_KEEP
2022-05-04 8:54 gas: set_symtab()'s setting of BSF_KEEP Jan Beulich
@ 2022-05-04 9:36 ` Alan Modra
0 siblings, 0 replies; 2+ messages in thread
From: Alan Modra @ 2022-05-04 9:36 UTC (permalink / raw)
To: Jan Beulich; +Cc: Binutils
On Wed, May 04, 2022 at 10:54:25AM +0200, Jan Beulich wrote:
> Alan,
>
> while looking into how to address an Arm64 regression I ended up
> coming across this code, originating from commit 76d129399558. The
> first thing that puzzled me was the != for checking BSF_SECTION_SYM.
The test is to prevent any attempt to change the const global_syms[].
That's why flags != BSF_SECTION_SYM is quite OK. It would be cleaner
to write a bfd_is_const_symbol similar to bfd_is_const_section.
--
Alan Modra
Australia Development Lab, IBM
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-05-04 9:36 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-04 8:54 gas: set_symtab()'s setting of BSF_KEEP Jan Beulich
2022-05-04 9:36 ` Alan Modra
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).