On Wed, 4 Nov 2020, H.J. Lu wrote: > On Wed, Nov 4, 2020 at 1:56 PM Hans-Peter Nilsson <h...@bitrange.com> wrote: > > On Wed, 4 Nov 2020, H.J. Lu wrote: > > > > > On Wed, Nov 4, 2020 at 1:03 PM Hans-Peter Nilsson <h...@bitrange.com> > > > wrote: > > > > > > > > On Wed, 4 Nov 2020, H.J. Lu wrote: > > > > > On Wed, Nov 4, 2020 at 10:09 AM Hans-Peter Nilsson > > > > > <h...@bitrange.com> wrote: > > > > > > I'm not much more than a random voice, but an assembly directive > > > > > > that specifies the symbol (IIUC your .retain directive) to > > > > > > > > > > But .retain directive DOES NOT adjust symbol attribute. > > > > I see I missed to point out that I was speaking about the *gcc > > symbol* attribute "used". > > There is no such corresponding symbol attribute in ELF.
I have not missed that, nor that SHF_GNU_RETAIN is so new that it's not in binutils master. I have also not missed that gcc caters to other object formats too. A common symbol-specific directive such as .retain, would be better than messing with section attributes, for gcc. > > It's cleaner to the compiler if it can pass on to the assembler > > the specific symbol that needs to be kept. > > > > SHF_GNU_RETAIN is for section and GCC should place the symbol, > which should be kept, in the SHF_GNU_RETAIN section directly, not > through .retain directive. This is where opinions differ. Anyway, this is now repetition; I'm done. brgds, H-P