Skip to content

Commit bc54316

Browse files
kvanheesmasahir0y
authored andcommitted
kbuild: exclude .rodata.(cst|str)* when building ranges
The .rodata.(cst|str)* sections are often resized during the final linking and since these sections do not cover actual symbols there is no need to include them in the modules.builtin.ranges data. When these sections were included in processing and resizing occurred, modules were reported with ranges that extended beyond their true end, causing subsequent symbols (in address order) to be associated with the wrong module. Fixes: 5f5e734 ("kbuild: generate offset range data for builtin modules") Cc: [email protected] Signed-off-by: Kris Van Hees <[email protected]> Reviewed-by: Jack Vogel <[email protected]>
1 parent ec43aa0 commit bc54316

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

scripts/generate_builtin_ranges.awk

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -282,6 +282,11 @@ ARGIND == 2 && !anchor && NF == 2 && $1 ~ /^0x/ && $2 !~ /^0x/ {
282282
# section.
283283
#
284284
ARGIND == 2 && sect && NF == 4 && /^ [^ \*]/ && !($1 in sect_addend) {
285+
# There are a few sections with constant data (without symbols) that
286+
# can get resized during linking, so it is best to ignore them.
287+
if ($1 ~ /^\.rodata\.(cst|str)[0-9]/)
288+
next;
289+
285290
if (!($1 in sect_base)) {
286291
sect_base[$1] = base;
287292

0 commit comments

Comments
 (0)