lkml.org 
[lkml]   [2020]   [Feb]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 2/2] x86/boot/compressed: Remove unnecessary sections from bzImage
On 2020-02-24, Arvind Sankar wrote:
>On Mon, Feb 24, 2020 at 01:28:28PM -0800, Fangrui Song wrote:
>> Hi Michael, please see my other reply on this thread: https://lkml.org/lkml/2020/2/24/47
>>
>> Synthesized sections can be matched as well. For example, SECTIONS { .pltfoo : { *(.plt) }} can rename the output section .plt to .pltfoo
>> It seems that in GNU ld, the synthesized section is associated with the
>> original object file, so it can be written as:
>>
>> SECTIONS { .pltfoo : { a.o(.plt) }}
>>
>> In lld, you need a wildcard to match the synthesized section *(.plt)
>>
>> .rela.dyn is another example.
>>
>
>With the BFD toolchain, file matching doesn't actually seem to work at
>least for .rela.dyn. I've tried playing around with it in the past and
>if you try to use file-matching to capture relocations from a particular
>input file, it just doesn't work sensibly.

I think most things are working in GNU ld...

/* a.x */
SECTIONS {
.rela.pltfoo : { a.o(.rela.plt) } /* *(.rela.plt) with lld */
.rela.dynfoo : { a.o(.rela.data) } /* *(.rela.dyn) with lld */
}

% cat <<e > a.s
.globl foo
foo:
call bar
.data
.quad quz
e
% as a.s -o a.o
% ld.bfd -T a.x a.o -shared -o a.so

\
 
 \ /
  Last update: 2020-02-24 23:17    [W:0.206 / U:0.464 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site