Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in
  • L linux-rm
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 0
    • Issues 0
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
    • Requirements
  • Merge requests 0
    • Merge requests 0
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Monitor
    • Monitor
    • Metrics
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • linux-arm
  • linux-rm
  • Repository
Switch branch/tag
  • linux-rm
  • arch
  • powerpc
  • Makefile
Find file BlameHistoryPermalink
  • Fangrui Song's avatar
    powerpc: Add "-z notext" flag to disable diagnostic · 03557853
    Fangrui Song authored Aug 13, 2021
    
    
    Object files used to link .tmp_vmlinux.kallsyms1 have many
    R_PPC64_ADDR64 relocations in non-SHF_WRITE sections. There are many
    text relocations (e.g. in .rela___ksymtab_gpl+* and .rela__mcount_loc
    sections) in a -pie link and are disallowed by LLD:
    
      ld.lld: error: can't create dynamic relocation R_PPC64_ADDR64 against local symbol in readonly segment; recompile object files with -fPIC or pass '-Wl,-z,notext' to allow text relocations in the output
      >>> defined in arch/powerpc/kernel/head_64.o
      >>> referenced by arch/powerpc/kernel/head_64.o:(__restart_table+0x10)
    
    Newer GNU ld configured with "--enable-textrel-check=error" will report
    an error as well:
    
      $ ld-new -EL -m elf64lppc -pie ... -o .tmp_vmlinux.kallsyms1 ...
      ld-new: read-only segment has dynamic relocations
    
    Add "-z notext" to suppress the errors. Non-CONFIG_RELOCATABLE builds
    use the default -no-pie mode and thus R_PPC64_ADDR64 relocations can be
    resolved at link-time.
    
    Reported-by: default avatarItaru Kitayama <itaru.kitayama@riken.jp>
    Co-developed-by: default avatarBill Wendling <morbo@google.com>
    Signed-off-by: default avatarFangrui Song <maskray@google.com>
    Signed-off-by: default avatarBill Wendling <morbo@google.com>
    Reviewed-by: default avatarNick Desaulniers <ndesaulniers@google.com>
    Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
    Link: https://lore.kernel.org/r/20210813200511.1905703-1-morbo@google.com
    03557853